- java.lang.Object
-
- com.lmax.disruptor.dsl.EventHandlerGroup<T>
-
- Type Parameters:
T- the type of entry used by the event processors.
public class EventHandlerGroup<T> extends java.lang.ObjectA group ofEventProcessors used as part of theDisruptor.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventHandlerGroup<T>and(EventHandlerGroup<T> otherHandlerGroup)Create a new event handler group that combines the consumers in this group withotherHandlerGroup.EventHandlerGroup<T>and(EventProcessor... processors)Create a new event handler group that combines the handlers in this group withprocessors.SequenceBarrierasSequenceBarrier()Create a dependency barrier for the processors in this group.EventHandlerGroup<T>handleEventsWith(BatchRewindStrategy batchRewindStrategy, RewindableEventHandler<? super T>... handlers)Set up batch handlers to handle events from the ring buffer.EventHandlerGroup<T>handleEventsWith(EventProcessorFactory<T>... eventProcessorFactories)Set up custom event processors to handle events from the ring buffer.EventHandlerGroup<T>handleEventsWith(EventHandler<? super T>... handlers)Set up batch handlers to handle events from the ring buffer.EventHandlerGroup<T>then(BatchRewindStrategy batchRewindStrategy, RewindableEventHandler<? super T>... handlers)Set up batch handlers to consume events from the ring buffer.EventHandlerGroup<T>then(EventProcessorFactory<T>... eventProcessorFactories)Set up custom event processors to handle events from the ring buffer.EventHandlerGroup<T>then(EventHandler<? super T>... handlers)Set up batch handlers to consume events from the ring buffer.
-
-
-
Method Detail
-
and
public EventHandlerGroup<T> and(EventHandlerGroup<T> otherHandlerGroup)
Create a new event handler group that combines the consumers in this group withotherHandlerGroup.- Parameters:
otherHandlerGroup- the event handler group to combine.- Returns:
- a new EventHandlerGroup combining the existing and new consumers into a single dependency group.
-
and
public EventHandlerGroup<T> and(EventProcessor... processors)
Create a new event handler group that combines the handlers in this group withprocessors.- Parameters:
processors- the processors to combine.- Returns:
- a new EventHandlerGroup combining the existing and new processors into a single dependency group.
-
then
@SafeVarargs public final EventHandlerGroup<T> then(EventHandler<? super T>... handlers)
Set up batch handlers to consume events from the ring buffer. These handlers will only process events after every
EventProcessorin this group has processed the event.This method is generally used as part of a chain. For example if the handler
Amust process events before handlerB:dw.handleEventsWith(A).then(B);- Parameters:
handlers- the batch handlers that will process events.- Returns:
- a
EventHandlerGroupthat can be used to set up a event processor barrier over the created event processors.
-
then
@SafeVarargs public final EventHandlerGroup<T> then(BatchRewindStrategy batchRewindStrategy, RewindableEventHandler<? super T>... handlers)
Set up batch handlers to consume events from the ring buffer. These handlers will only process events after every
EventProcessorin this group has processed the event.This method is generally used as part of a chain. For example if the handler
Amust process events before handlerB:dw.handleEventsWith(A).then(B);- Parameters:
batchRewindStrategy- aBatchRewindStrategyfor customizing how to handle aRewindableException.handlers- the rewindable event handlers that will process events.- Returns:
- a
EventHandlerGroupthat can be used to set up a event processor barrier over the created event processors.
-
then
@SafeVarargs public final EventHandlerGroup<T> then(EventProcessorFactory<T>... eventProcessorFactories)
Set up custom event processors to handle events from the ring buffer. The Disruptor will automatically start these processors when
Disruptor.start()is called.This method is generally used as part of a chain. For example if the handler
Amust process events before handlerB:- Parameters:
eventProcessorFactories- the event processor factories to use to create the event processors that will process events.- Returns:
- a
EventHandlerGroupthat can be used to chain dependencies.
-
handleEventsWith
@SafeVarargs public final EventHandlerGroup<T> handleEventsWith(EventHandler<? super T>... handlers)
Set up batch handlers to handle events from the ring buffer. These handlers will only process events after every
EventProcessorin this group has processed the event.This method is generally used as part of a chain. For example if
Amust process events beforeB:dw.after(A).handleEventsWith(B);- Parameters:
handlers- the batch handlers that will process events.- Returns:
- a
EventHandlerGroupthat can be used to set up a event processor barrier over the created event processors.
-
handleEventsWith
@SafeVarargs public final EventHandlerGroup<T> handleEventsWith(BatchRewindStrategy batchRewindStrategy, RewindableEventHandler<? super T>... handlers)
Set up batch handlers to handle events from the ring buffer. These handlers will only process events after every
EventProcessorin this group has processed the event.This method is generally used as part of a chain. For example if
Amust process events beforeB:dw.after(A).handleEventsWith(B);- Parameters:
batchRewindStrategy- aBatchRewindStrategyfor customizing how to handle aRewindableException.handlers- the rewindable event handlers that will process events.- Returns:
- a
EventHandlerGroupthat can be used to set up a event processor barrier over the created event processors.
-
handleEventsWith
@SafeVarargs public final EventHandlerGroup<T> handleEventsWith(EventProcessorFactory<T>... eventProcessorFactories)
Set up custom event processors to handle events from the ring buffer. The Disruptor will automatically start these processors when
Disruptor.start()is called.This method is generally used as part of a chain. For example if
Amust process events beforeB:dw.after(A).handleEventsWith(B);- Parameters:
eventProcessorFactories- the event processor factories to use to create the event processors that will process events.- Returns:
- a
EventHandlerGroupthat can be used to chain dependencies.
-
asSequenceBarrier
public SequenceBarrier asSequenceBarrier()
Create a dependency barrier for the processors in this group. This allows custom event processors to have dependencies onBatchEventProcessors created by the disruptor.- Returns:
- a
SequenceBarrierincluding all the processors in this group.
-
-