Package io.netty.util.concurrent
Class SingleThreadEventExecutor
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- io.netty.util.concurrent.AbstractEventExecutor
-
- io.netty.util.concurrent.AbstractScheduledEventExecutor
-
- io.netty.util.concurrent.SingleThreadEventExecutor
-
- All Implemented Interfaces:
EventExecutor
,EventExecutorGroup
,OrderedEventExecutor
,ThreadAwareExecutor
,java.lang.Iterable<EventExecutor>
,java.util.concurrent.Executor
,java.util.concurrent.ExecutorService
,java.util.concurrent.ScheduledExecutorService
- Direct Known Subclasses:
DefaultEventExecutor
,SingleThreadEventLoop
public abstract class SingleThreadEventExecutor extends AbstractScheduledEventExecutor implements OrderedEventExecutor
Abstract base class forOrderedEventExecutor
's that execute all its submitted tasks in a single thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
SingleThreadEventExecutor.NonWakeupRunnable
Deprecated.overridewakesUpForTask(java.lang.Runnable)
to re-create this behaviour-
Nested classes/interfaces inherited from class io.netty.util.concurrent.AbstractEventExecutor
AbstractEventExecutor.LazyRunnable
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp)
Create a new instanceprotected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, boolean supportSuspension, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instanceprotected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, boolean supportSuspension, java.util.Queue<java.lang.Runnable> taskQueue, RejectedExecutionHandler rejectedHandler)
protected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instanceprotected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, java.util.Queue<java.lang.Runnable> taskQueue, RejectedExecutionHandler rejectedHandler)
protected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp)
Create a new instanceprotected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, boolean supportSuspension, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instanceprotected
SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instance
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addShutdownHook(java.lang.Runnable task)
Add aRunnable
which will be executed on shutdown of this instanceprotected void
addTask(java.lang.Runnable task)
Add a task to the task queue, or throws aRejectedExecutionException
if this instance was shutdown before.protected void
afterRunningAllTasks()
Invoked before returning fromrunAllTasks()
andrunAllTasks(long)
.boolean
awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
protected boolean
canSuspend()
protected boolean
canSuspend(int state)
protected void
cleanup()
Do nothing, sub-classes may overrideprotected boolean
confirmShutdown()
Confirm that the shutdown if the instance should be done now!protected long
deadlineNanos()
Returns the absolute point in time (relative toAbstractScheduledEventExecutor.getCurrentTimeNanos()
) at which the next closest scheduled task should run.protected long
delayNanos(long currentTimeNanos)
Returns the amount of time left until the scheduled task with the closest dead line is executed.void
execute(java.lang.Runnable task)
protected boolean
hasTasks()
boolean
inEventLoop(java.lang.Thread thread)
Returntrue
if the givenThread
is executed in the event loop,false
otherwise.protected void
interruptThread()
Interrupt the current runningThread
.<T> java.util.List<java.util.concurrent.Future<T>>
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
<T> java.util.List<java.util.concurrent.Future<T>>
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit)
<T> T
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
<T> T
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit)
boolean
isShutdown()
boolean
isShuttingDown()
Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.boolean
isSuspended()
Returnstrue
if theEventExecutor
is considered suspended.boolean
isTerminated()
void
lazyExecute(java.lang.Runnable task)
LikeExecutor.execute(Runnable)
but does not guarantee the task will be run until either a non-lazy task is executed or the executor is shut down.protected java.util.Queue<java.lang.Runnable>
newTaskQueue()
Deprecated.Please use and overridenewTaskQueue(int)
.protected java.util.Queue<java.lang.Runnable>
newTaskQueue(int maxPendingTasks)
Create a newQueue
which will holds the tasks to execute.protected java.lang.Runnable
peekTask()
int
pendingTasks()
Return the number of tasks that are pending for processing.protected java.lang.Runnable
pollTask()
protected static java.lang.Runnable
pollTaskFrom(java.util.Queue<java.lang.Runnable> taskQueue)
protected static void
reject()
protected void
reject(java.lang.Runnable task)
Offers the task to the associatedRejectedExecutionHandler
.void
removeShutdownHook(java.lang.Runnable task)
Remove a previous addedRunnable
as a shutdown hookprotected boolean
removeTask(java.lang.Runnable task)
protected abstract void
run()
Run the tasks in thetaskQueue
protected boolean
runAllTasks()
Poll all tasks from the task queue and run them viaRunnable.run()
method.protected boolean
runAllTasks(long timeoutNanos)
Poll all tasks from the task queue and run them viaRunnable.run()
method.protected boolean
runAllTasksFrom(java.util.Queue<java.lang.Runnable> taskQueue)
Runs all tasks from the passedtaskQueue
.protected boolean
runScheduledAndExecutorTasks(int maxDrainAttempts)
Execute all expired scheduled tasks and all current tasks in the executor queue until both queues are empty, ormaxDrainAttempts
has been exceeded.void
shutdown()
Deprecated.Future<?>
shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.protected java.lang.Runnable
takeTask()
Take the nextRunnable
from the task queue and so will block if no task is currently present.Future<?>
terminationFuture()
Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.ThreadProperties
threadProperties()
boolean
trySuspend()
Try to suspend thisEventExecutor
and returntrue
if suspension was successful.protected void
updateLastExecutionTime()
Updates the internal timestamp that tells when a submitted task was executed most recently.protected boolean
wakesUpForTask(java.lang.Runnable task)
Can be overridden to control which tasks require waking theEventExecutor
thread if it is waiting so that they can be run immediately.protected void
wakeup(boolean inEventLoop)
-
Methods inherited from class io.netty.util.concurrent.AbstractScheduledEventExecutor
afterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, delayNanos, fetchFromScheduledTaskQueue, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, validateScheduled
-
Methods inherited from class io.netty.util.concurrent.AbstractEventExecutor
iterator, newTaskFor, newTaskFor, next, parent, runTask, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.util.concurrent.EventExecutor
inEventLoop, isExecutorThread, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, parent
-
Methods inherited from interface io.netty.util.concurrent.EventExecutorGroup
iterator, next, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
-
-
-
-
Constructor Detail
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itthreadFactory
- theThreadFactory
which will be used for the usedThread
addTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor thread
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itthreadFactory
- theThreadFactory
which will be used for the usedThread
addTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor threadmaxPendingTasks
- the maximum number of pending tasks before new tasks will be rejected.rejectedHandler
- theRejectedExecutionHandler
to use.
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, boolean supportSuspension, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itthreadFactory
- theThreadFactory
which will be used for the usedThread
addTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor threadsupportSuspension
-true
if suspension of thisSingleThreadEventExecutor
is supported.maxPendingTasks
- the maximum number of pending tasks before new tasks will be rejected.rejectedHandler
- theRejectedExecutionHandler
to use.
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itexecutor
- theExecutor
which will be used for executingaddTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor thread
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itexecutor
- theExecutor
which will be used for executingaddTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor threadmaxPendingTasks
- the maximum number of pending tasks before new tasks will be rejected.rejectedHandler
- theRejectedExecutionHandler
to use.
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, boolean supportSuspension, int maxPendingTasks, RejectedExecutionHandler rejectedHandler)
Create a new instance- Parameters:
parent
- theEventExecutorGroup
which is the parent of this instance and belongs to itexecutor
- theExecutor
which will be used for executingaddTaskWakesUp
-true
if and only if invocation ofaddTask(Runnable)
will wake up the executor threadsupportSuspension
-true
if suspension of thisSingleThreadEventExecutor
is supported.maxPendingTasks
- the maximum number of pending tasks before new tasks will be rejected.rejectedHandler
- theRejectedExecutionHandler
to use.
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, java.util.Queue<java.lang.Runnable> taskQueue, RejectedExecutionHandler rejectedHandler)
-
SingleThreadEventExecutor
protected SingleThreadEventExecutor(EventExecutorGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, boolean supportSuspension, java.util.Queue<java.lang.Runnable> taskQueue, RejectedExecutionHandler rejectedHandler)
-
-
Method Detail
-
newTaskQueue
@Deprecated protected java.util.Queue<java.lang.Runnable> newTaskQueue()
Deprecated.Please use and overridenewTaskQueue(int)
.
-
newTaskQueue
protected java.util.Queue<java.lang.Runnable> newTaskQueue(int maxPendingTasks)
Create a newQueue
which will holds the tasks to execute. This default implementation will return aLinkedBlockingQueue
but if your sub-class ofSingleThreadEventExecutor
will not do any blocking calls on the thisQueue
it may make sense to@Override
this and return some more performant implementation that does not support blocking operations at all.
-
interruptThread
protected void interruptThread()
Interrupt the current runningThread
.
-
pollTask
protected java.lang.Runnable pollTask()
- See Also:
Queue.poll()
-
pollTaskFrom
protected static java.lang.Runnable pollTaskFrom(java.util.Queue<java.lang.Runnable> taskQueue)
-
takeTask
protected java.lang.Runnable takeTask()
Take the nextRunnable
from the task queue and so will block if no task is currently present.Be aware that this method will throw an
UnsupportedOperationException
if the task queue, which was created vianewTaskQueue()
, does not implementBlockingQueue
.- Returns:
null
if the executor thread has been interrupted or waken up.
-
peekTask
protected java.lang.Runnable peekTask()
- See Also:
Queue.peek()
-
hasTasks
protected boolean hasTasks()
- See Also:
Collection.isEmpty()
-
pendingTasks
public int pendingTasks()
Return the number of tasks that are pending for processing.
-
addTask
protected void addTask(java.lang.Runnable task)
Add a task to the task queue, or throws aRejectedExecutionException
if this instance was shutdown before.
-
removeTask
protected boolean removeTask(java.lang.Runnable task)
- See Also:
Collection.remove(Object)
-
runAllTasks
protected boolean runAllTasks()
Poll all tasks from the task queue and run them viaRunnable.run()
method.- Returns:
true
if and only if at least one task was run
-
runScheduledAndExecutorTasks
protected final boolean runScheduledAndExecutorTasks(int maxDrainAttempts)
Execute all expired scheduled tasks and all current tasks in the executor queue until both queues are empty, ormaxDrainAttempts
has been exceeded.- Parameters:
maxDrainAttempts
- The maximum amount of times this method attempts to drain from queues. This is to prevent continuous task execution and scheduling from preventing the EventExecutor thread to make progress and return to the selector mechanism to process inbound I/O events.- Returns:
true
if at least one task was run.
-
runAllTasksFrom
protected final boolean runAllTasksFrom(java.util.Queue<java.lang.Runnable> taskQueue)
Runs all tasks from the passedtaskQueue
.- Parameters:
taskQueue
- To poll and execute all tasks.- Returns:
true
if at least one task was executed.
-
runAllTasks
protected boolean runAllTasks(long timeoutNanos)
Poll all tasks from the task queue and run them viaRunnable.run()
method. This method stops running the tasks in the task queue and returns if it ran longer thantimeoutNanos
.
-
afterRunningAllTasks
protected void afterRunningAllTasks()
Invoked before returning fromrunAllTasks()
andrunAllTasks(long)
.
-
delayNanos
protected long delayNanos(long currentTimeNanos)
Returns the amount of time left until the scheduled task with the closest dead line is executed.
-
deadlineNanos
protected long deadlineNanos()
Returns the absolute point in time (relative toAbstractScheduledEventExecutor.getCurrentTimeNanos()
) at which the next closest scheduled task should run.
-
updateLastExecutionTime
protected void updateLastExecutionTime()
Updates the internal timestamp that tells when a submitted task was executed most recently.runAllTasks()
andrunAllTasks(long)
updates this timestamp automatically, and thus there's usually no need to call this method. However, if you take the tasks manually usingtakeTask()
orpollTask()
, you have to call this method at the end of task execution loop for accurate quiet period checks.
-
run
protected abstract void run()
Run the tasks in thetaskQueue
-
cleanup
protected void cleanup()
Do nothing, sub-classes may override
-
wakeup
protected void wakeup(boolean inEventLoop)
-
inEventLoop
public boolean inEventLoop(java.lang.Thread thread)
Description copied from interface:EventExecutor
Returntrue
if the givenThread
is executed in the event loop,false
otherwise.- Specified by:
inEventLoop
in interfaceEventExecutor
-
addShutdownHook
public void addShutdownHook(java.lang.Runnable task)
Add aRunnable
which will be executed on shutdown of this instance
-
removeShutdownHook
public void removeShutdownHook(java.lang.Runnable task)
Remove a previous addedRunnable
as a shutdown hook
-
shutdownGracefully
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
Description copied from interface:EventExecutorGroup
Signals this executor that the caller wants the executor to be shut down. Once this method is called,EventExecutorGroup.isShuttingDown()
starts to returntrue
, and the executor prepares to shut itself down. UnlikeEventExecutorGroup.shutdown()
, graceful shutdown ensures that no tasks are submitted for 'the quiet period' (usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period, it is guaranteed to be accepted and the quiet period will start over.- Specified by:
shutdownGracefully
in interfaceEventExecutorGroup
- Parameters:
quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown() regardless if a task was submitted during the quiet periodunit
- the unit ofquietPeriod
andtimeout
- Returns:
- the
EventExecutorGroup.terminationFuture()
-
terminationFuture
public Future<?> terminationFuture()
Description copied from interface:EventExecutorGroup
Returns theFuture
which is notified when allEventExecutor
s managed by thisEventExecutorGroup
have been terminated.- Specified by:
terminationFuture
in interfaceEventExecutorGroup
-
shutdown
@Deprecated public void shutdown()
Deprecated.- Specified by:
shutdown
in interfaceEventExecutorGroup
- Specified by:
shutdown
in interfacejava.util.concurrent.ExecutorService
- Specified by:
shutdown
in classAbstractEventExecutor
-
isShuttingDown
public boolean isShuttingDown()
Description copied from interface:EventExecutorGroup
Returnstrue
if and only if allEventExecutor
s managed by thisEventExecutorGroup
are being shut down gracefully or was shut down.- Specified by:
isShuttingDown
in interfaceEventExecutorGroup
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacejava.util.concurrent.ExecutorService
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacejava.util.concurrent.ExecutorService
-
isSuspended
public boolean isSuspended()
Description copied from interface:EventExecutor
Returnstrue
if theEventExecutor
is considered suspended.- Specified by:
isSuspended
in interfaceEventExecutor
- Returns:
true
if suspended,false
otherwise.
-
trySuspend
public boolean trySuspend()
Description copied from interface:EventExecutor
Try to suspend thisEventExecutor
and returntrue
if suspension was successful. Suspending anEventExecutor
will allow it to free up resources, like for example aThread
that is backing theEventExecutor
. Once anEventExecutor
was suspended it will be started again by submitting work to it via one of the following methods:Executor.execute(Runnable)
EventExecutorGroup.schedule(Runnable, long, TimeUnit)
EventExecutorGroup.schedule(Callable, long, TimeUnit)
EventExecutorGroup.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
EventExecutorGroup.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
true
it might take some time for theEventExecutor
to fully suspend itself.- Specified by:
trySuspend
in interfaceEventExecutor
- Returns:
true
if suspension was successful, otherwisefalse
.
-
canSuspend
protected boolean canSuspend()
- Returns:
- if suspension is possible at the moment.
-
canSuspend
protected boolean canSuspend(int state)
Returnstrue
if thisSingleThreadEventExecutor
can be suspended at the moment,false
otherwise. Subclasses might override this method to add extra checks.- Parameters:
state
- the current internal state of theSingleThreadEventExecutor
.- Returns:
- if suspension is possible at the moment.
-
confirmShutdown
protected boolean confirmShutdown()
Confirm that the shutdown if the instance should be done now!
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
awaitTermination
in interfacejava.util.concurrent.ExecutorService
- Throws:
java.lang.InterruptedException
-
execute
public void execute(java.lang.Runnable task)
- Specified by:
execute
in interfacejava.util.concurrent.Executor
-
lazyExecute
public void lazyExecute(java.lang.Runnable task)
Description copied from class:AbstractEventExecutor
LikeExecutor.execute(Runnable)
but does not guarantee the task will be run until either a non-lazy task is executed or the executor is shut down.The default implementation just delegates to
Executor.execute(Runnable)
.- Overrides:
lazyExecute
in classAbstractEventExecutor
-
invokeAny
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
- Specified by:
invokeAny
in interfacejava.util.concurrent.ExecutorService
- Overrides:
invokeAny
in classjava.util.concurrent.AbstractExecutorService
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
-
invokeAny
public <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
- Specified by:
invokeAny
in interfacejava.util.concurrent.ExecutorService
- Overrides:
invokeAny
in classjava.util.concurrent.AbstractExecutorService
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
-
invokeAll
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks) throws java.lang.InterruptedException
- Specified by:
invokeAll
in interfacejava.util.concurrent.ExecutorService
- Overrides:
invokeAll
in classjava.util.concurrent.AbstractExecutorService
- Throws:
java.lang.InterruptedException
-
invokeAll
public <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
invokeAll
in interfacejava.util.concurrent.ExecutorService
- Overrides:
invokeAll
in classjava.util.concurrent.AbstractExecutorService
- Throws:
java.lang.InterruptedException
-
threadProperties
public final ThreadProperties threadProperties()
Returns theThreadProperties
of theThread
that powers theSingleThreadEventExecutor
. If theSingleThreadEventExecutor
is not started yet, this operation will start it and block until it is fully started.
-
wakesUpForTask
protected boolean wakesUpForTask(java.lang.Runnable task)
Can be overridden to control which tasks require waking theEventExecutor
thread if it is waiting so that they can be run immediately.
-
reject
protected static void reject()
-
reject
protected final void reject(java.lang.Runnable task)
Offers the task to the associatedRejectedExecutionHandler
.- Parameters:
task
- to reject.
-
-