T - Type of dispatched signalpublic static final class WorkQueueProcessor.Builder<T> extends Object
WorkQueueProcessor builder that can be used to create new
processors. Instantiate it through the WorkQueueProcessor.builder() static
method:
WorkQueueProcessor<String> processor = WorkQueueProcessor.<String>builder().build()
| Modifier and Type | Method and Description |
|---|---|
WorkQueueProcessor.Builder<T> |
autoCancel(boolean autoCancel)
Configures auto-cancel for this builder.
|
WorkQueueProcessor.Builder<T> |
bufferSize(int bufferSize)
Configures buffer size for this builder.
|
WorkQueueProcessor<T> |
build()
Creates a new
WorkQueueProcessor using the properties
of this builder. |
WorkQueueProcessor.Builder<T> |
executor(ExecutorService executor)
Configures an
ExecutorService to execute as many event-loop consuming the
ringbuffer as subscribers. |
WorkQueueProcessor.Builder<T> |
name(String name)
Configures name for this builder.
|
WorkQueueProcessor.Builder<T> |
requestTaskExecutor(ExecutorService requestTaskExecutor)
Configures an additional
ExecutorService that is used internally
on each subscription. |
WorkQueueProcessor.Builder<T> |
share(boolean share)
Configures sharing state for this builder.
|
WorkQueueProcessor.Builder<T> |
waitStrategy(WaitStrategy waitStrategy)
Configures wait strategy for this builder.
|
public WorkQueueProcessor.Builder<T> name(@Nullable String name)
name is null.name - Use a new cached ExecutorService and assign this name to the created threads
if executor(ExecutorService) is not configured.public WorkQueueProcessor.Builder<T> bufferSize(int bufferSize)
Queues.SMALL_BUFFER_SIZE.bufferSize - the internal buffer size to hold signals, must be a power of 2public WorkQueueProcessor.Builder<T> waitStrategy(@Nullable WaitStrategy waitStrategy)
WaitStrategy.liteBlocking().
Wait strategy is push to default if the provided waitStrategy is null.waitStrategy - A RingBuffer WaitStrategy to use instead of the default smart blocking wait strategy.public WorkQueueProcessor.Builder<T> autoCancel(boolean autoCancel)
autoCancel - automatically cancelpublic WorkQueueProcessor.Builder<T> executor(@Nullable ExecutorService executor)
ExecutorService to execute as many event-loop consuming the
ringbuffer as subscribers. Name configured using name(String) will be ignored
if executor is push.executor - A provided ExecutorService to manage threading infrastructurepublic WorkQueueProcessor.Builder<T> requestTaskExecutor(@Nullable ExecutorService requestTaskExecutor)
ExecutorService that is used internally
on each subscription.requestTaskExecutor - internal request executorpublic WorkQueueProcessor.Builder<T> share(boolean share)
share - true to support concurrent onNext callspublic WorkQueueProcessor<T> build()
WorkQueueProcessor using the properties
of this builder.