- java.lang.Object
-
- com.lmax.disruptor.BatchEventProcessorBuilder
-
public final class BatchEventProcessorBuilder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BatchEventProcessorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> BatchEventProcessor<T>
build(DataProvider<T> dataProvider, SequenceBarrier sequenceBarrier, EventHandler<? super T> eventHandler)
Construct aEventProcessor
that will automatically track the progress by updating its sequence when theEventHandler.onEvent(Object, long, boolean)
method returns.<T> BatchEventProcessor<T>
build(DataProvider<T> dataProvider, SequenceBarrier sequenceBarrier, RewindableEventHandler<? super T> rewindableEventHandler, BatchRewindStrategy batchRewindStrategy)
Construct aEventProcessor
that will automatically track the progress by updating its sequence when theEventHandler.onEvent(Object, long, boolean)
method returns.BatchEventProcessorBuilder
setMaxBatchSize(int maxBatchSize)
Set the maximum number of events that will be processed in a batch before updating the sequence.
-
-
-
Method Detail
-
setMaxBatchSize
public BatchEventProcessorBuilder setMaxBatchSize(int maxBatchSize)
Set the maximum number of events that will be processed in a batch before updating the sequence.- Parameters:
maxBatchSize
- max number of events to process in one batch.- Returns:
- The builder
-
build
public <T> BatchEventProcessor<T> build(DataProvider<T> dataProvider, SequenceBarrier sequenceBarrier, EventHandler<? super T> eventHandler)
Construct aEventProcessor
that will automatically track the progress by updating its sequence when theEventHandler.onEvent(Object, long, boolean)
method returns.The created
BatchEventProcessor
will not support batch rewind, butEventHandler.setSequenceCallback(Sequence)
will be supported.- Type Parameters:
T
- event implementation storing the data for sharing during exchange or parallel coordination of an event.- Parameters:
dataProvider
- to which events are published.sequenceBarrier
- on which it is waiting.eventHandler
- is the delegate to which events are dispatched.- Returns:
- the BatchEventProcessor
-
build
public <T> BatchEventProcessor<T> build(DataProvider<T> dataProvider, SequenceBarrier sequenceBarrier, RewindableEventHandler<? super T> rewindableEventHandler, BatchRewindStrategy batchRewindStrategy)
Construct aEventProcessor
that will automatically track the progress by updating its sequence when theEventHandler.onEvent(Object, long, boolean)
method returns.- Type Parameters:
T
- event implementation storing the data for sharing during exchange or parallel coordination of an event.- Parameters:
dataProvider
- to which events are published.sequenceBarrier
- on which it is waiting.rewindableEventHandler
- is the delegate to which events are dispatched.batchRewindStrategy
- aBatchRewindStrategy
for customizing how to handle aRewindableException
.- Returns:
- the BatchEventProcessor
-
-