public class OperationBatcherSpec<T> extends java.lang.Object implements reactor.fn.Supplier<OperationBatcher<T>>
OperationBatchers.| Constructor and Description |
|---|
OperationBatcherSpec() |
| Modifier and Type | Method and Description |
|---|---|
OperationBatcherSpec<T> |
blockingWaitStrategy()
Set
com.lmax.disruptor.BlockingWaitStrategy as wait strategy. |
OperationBatcherSpec<T> |
busySpinWaitStrategy()
Set
com.lmax.disruptor.BusySpinWaitStrategy as wait strategy. |
OperationBatcherSpec<T> |
consume(reactor.fn.Consumer<T> consumer)
When data is mutated and published into the
Processor, invoke the given Consumer and pass the
mutated data. |
OperationBatcherSpec<T> |
dataBufferSize(int dataBufferSize)
How many data objects to pre-allocate in the buffer.
|
OperationBatcherSpec<T> |
dataSupplier(reactor.fn.Supplier<T> dataSupplier)
Use the given
Supplier to provide new instances of the data object for pre-allocation. |
OperationBatcher<T> |
get() |
OperationBatcherSpec<T> |
multiThreadedProducer()
Protect against publication of data events from multiple producer threads.
|
OperationBatcherSpec<T> |
singleThreadedProducer()
Optimize for highest throughput by assuming only a single thread will be publishing data events into this
Processor. |
OperationBatcherSpec<T> |
sleepingWaitStrategy()
Set
com.lmax.disruptor.SleepingWaitStrategy as wait strategy. |
OperationBatcherSpec<T> |
waitStrategy(reactor.jarjar.com.lmax.disruptor.WaitStrategy waitStrategy)
Set Disruptor's
com.lmax.disruptor.WaitStrategy. |
OperationBatcherSpec<T> |
when(java.lang.Class<? extends java.lang.Throwable> type,
reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
Assign the given
Consumer as an error handler for exceptions of the given type. |
OperationBatcherSpec<T> |
yieldingWaitStrategy()
Set
com.lmax.disruptor.YieldingWaitStrategy as wait strategy. |
public OperationBatcherSpec<T> multiThreadedProducer()
public OperationBatcherSpec<T> singleThreadedProducer()
Processor.public OperationBatcherSpec<T> dataBufferSize(int dataBufferSize)
dataBufferSize - number of data objects to pre-allocatepublic OperationBatcherSpec<T> dataSupplier(reactor.fn.Supplier<T> dataSupplier)
Supplier to provide new instances of the data object for pre-allocation.dataSupplier - the Supplier to provide new data instancespublic OperationBatcherSpec<T> waitStrategy(reactor.jarjar.com.lmax.disruptor.WaitStrategy waitStrategy)
com.lmax.disruptor.WaitStrategy.waitStrategy - the com.lmax.disruptor.WaitStrategy to usepublic OperationBatcherSpec<T> blockingWaitStrategy()
com.lmax.disruptor.BlockingWaitStrategy as wait strategy.public OperationBatcherSpec<T> sleepingWaitStrategy()
com.lmax.disruptor.SleepingWaitStrategy as wait strategy.public OperationBatcherSpec<T> yieldingWaitStrategy()
com.lmax.disruptor.YieldingWaitStrategy as wait strategy.public OperationBatcherSpec<T> busySpinWaitStrategy()
com.lmax.disruptor.BusySpinWaitStrategy as wait strategy.public OperationBatcherSpec<T> consume(reactor.fn.Consumer<T> consumer)
Processor, invoke the given Consumer and pass the
mutated data.consumer - the mutated event data Consumerpublic OperationBatcherSpec<T> when(java.lang.Class<? extends java.lang.Throwable> type, reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
Consumer as an error handler for exceptions of the given type.type - type of the exception to handleerrorConsumer - exception Consumerpublic OperationBatcher<T> get()
get in interface reactor.fn.Supplier<OperationBatcher<T>>