public final class DefaultEventExecutor extends Object implements EventExecutor
| Constructor and Description |
|---|
DefaultEventExecutor(ThreadFactory threadFactory,
int pendingTasksCapacity) |
| Modifier and Type | Method and Description |
|---|---|
<T> CompletableFuture<T> |
schedule(Callable<T> task,
long delay,
TimeUnit unit)
Submits a task for delayed execution.
|
CompletableFuture<Void> |
schedule(Runnable task,
long delay,
TimeUnit unit)
Submits a task for delayed execution.
|
CompletableFuture<Void> |
shutdown()
Shuts down the event executor.
|
<T> CompletableFuture<T> |
submit(Callable<T> task)
Submits a task for immediate execution.
|
CompletableFuture<Void> |
submit(Runnable task)
Submits a task for immediate execution.
|
public DefaultEventExecutor(ThreadFactory threadFactory, int pendingTasksCapacity)
public CompletableFuture<Void> submit(Runnable task)
EventExecutorsubmit in interface EventExecutortask - runnable to executepublic <T> CompletableFuture<T> submit(Callable<T> task)
EventExecutorsubmit in interface EventExecutortask - callable to executepublic CompletableFuture<Void> schedule(Runnable task, long delay, TimeUnit unit)
EventExecutorschedule in interface EventExecutortask - runnable to executedelay - the time from now to delay executionunit - the time unit of the delay parameterpublic <T> CompletableFuture<T> schedule(Callable<T> task, long delay, TimeUnit unit)
EventExecutorschedule in interface EventExecutortask - runnable to executedelay - the time from now to delay executionunit - the time unit of the delay parameterpublic CompletableFuture<Void> shutdown()
EventExecutorNo additional task will be accepted by the submit and schedule methods. Both methods will throw a RejectedExecutionException after this method is called.
All scheduled tasks that have not expired will not be executed by the event executor.
shutdown in interface EventExecutor