public class WorkQueueDispatcher extends AbstractMultiThreadDispatcher
Dispatcher that uses a multi-threaded, multi-producer RingBuffer to queue tasks
to execute.AbstractMultiThreadDispatcher.MultiThreadTaskAbstractLifecycleDispatcher.Task| Constructor and Description |
|---|
WorkQueueDispatcher(java.lang.String name,
int poolSize,
int backlog,
Consumer<java.lang.Throwable> uncaughtExceptionHandler) |
WorkQueueDispatcher(java.lang.String name,
int poolSize,
int backlog,
Consumer<java.lang.Throwable> uncaughtExceptionHandler,
com.lmax.disruptor.dsl.ProducerType producerType,
com.lmax.disruptor.WaitStrategy waitStrategy) |
| Modifier and Type | Method and Description |
|---|---|
protected AbstractLifecycleDispatcher.Task |
allocateTask() |
boolean |
awaitAndShutdown(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Block until all submitted tasks have completed, then do a normal
Dispatcher.shutdown(). |
protected void |
execute(AbstractLifecycleDispatcher.Task task) |
void |
halt()
Shutdown this
Dispatcher, forcibly halting any tasks currently executing and discarding any tasks that have
not yet been exected. |
void |
shutdown()
Shutdown this
Dispatcher such that it can no longer be used. |
addToTailRecursionPile, allocateRecursiveTask, getBacklogalive, awaitAndShutdown, dispatch, dispatch, execute, getContext, isInContext, routepublic WorkQueueDispatcher(java.lang.String name,
int poolSize,
int backlog,
Consumer<java.lang.Throwable> uncaughtExceptionHandler)
public WorkQueueDispatcher(java.lang.String name,
int poolSize,
int backlog,
Consumer<java.lang.Throwable> uncaughtExceptionHandler,
com.lmax.disruptor.dsl.ProducerType producerType,
com.lmax.disruptor.WaitStrategy waitStrategy)
public boolean awaitAndShutdown(long timeout,
java.util.concurrent.TimeUnit timeUnit)
DispatcherDispatcher.shutdown().public void shutdown()
DispatcherDispatcher such that it can no longer be used.shutdown in interface Dispatchershutdown in class AbstractLifecycleDispatcherpublic void halt()
DispatcherDispatcher, forcibly halting any tasks currently executing and discarding any tasks that have
not yet been exected.halt in interface Dispatcherhalt in class AbstractLifecycleDispatcherprotected AbstractLifecycleDispatcher.Task allocateTask()
allocateTask in class AbstractMultiThreadDispatcherprotected void execute(AbstractLifecycleDispatcher.Task task)
execute in class AbstractLifecycleDispatcher