Top Description Inners Fields Constructors Methods
io.netty5.util.concurrent

public final Class NonStickyEventExecutorGroup

extends Object
implements EventExecutorGroup
Class Inheritance
All Implemented Interfaces
io.netty5.util.concurrent.EventExecutorGroup, java.util.concurrent.Executor, java.lang.Iterable
Annotations
@UnstableApi
Imports
io.netty5.util.internal.PlatformDependent, .UnstableApi, java.util.Iterator, .Queue, java.util.concurrent.Callable, .RejectedExecutionException, .TimeUnit, java.util.concurrent.atomic.AtomicInteger

EventExecutorGroup which will preserve Runnable execution order but makes no guarantees about what EventExecutor (and therefore Thread) will be used to execute the Runnables.

The EventExecutorGroup#next() for the wrapped EventExecutorGroup must NOT return executors of type OrderedEventExecutor.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final EventExecutorGroup
private final int

Constructor Summary

AccessConstructor and Description
public
NonStickyEventExecutorGroup(EventExecutorGroup group)

Creates a new instance.

public
NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public boolean
awaitTermination(long
The non-negative maximum amount of time to wait for the executor group to terminate.
timeout
,
TimeUnit
The non-null time unit of the timeout.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Wait for this EventExecutorGroup to terminate, up to the given timeout.
public void
execute(Runnable
the runnable task
task
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.execute.

Executes the given command at some time in the future.
public boolean
isShutdown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Returns true if all EventExecutors managed by this EventExecutorGroup have been shut down gracefully and moved past the grace period so that they are no longer accepting any new tasks.
public boolean
public boolean
isTerminated()

Overrides default io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Returns true if all EventExecutors managed by this EventExecutorGroup are shut down, and all of their tasks have completed.
public Iterator<EventExecutor>
iterator()

Implements io.netty5.util.concurrent.EventExecutorGroup.iterator.

Returns an iterator over elements of type T.
private NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor
public EventExecutor
public Future<Void>
schedule(Runnable
The task that should be executed in this EventExecutorGroup after the given delay.
task
,
long
A positive time delay, in the given time unit.
delay
,
TimeUnit
The non-null time unit for the delay.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.
public <V> Future<V>
schedule(Callable<V>
The task that should be executed in this EventExecutorGroup after the given delay.
task
,
long
A positive time delay, in the given time unit.
delay
,
TimeUnit
The non-null time unit for the delay.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.
public Future<Void>
scheduleAtFixedRate(Runnable
The task that should be scheduled to execute at a fixed rate in this EventExecutorGroup.
task
,
long
The positive initial delay for the first task execution, in terms of the given time unit.
initialDelay
,
long
The positive period for the execution frequency to use after the first execution has started, in terms of the given time unit.
period
,
TimeUnit
The non-null time unit for the delay and period.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.scheduleAtFixedRate.

Schedule the given task for periodic execution in the next available EventExecutor.
public Future<Void>
scheduleWithFixedDelay(Runnable
The task that should be scheduled to execute with fixed delays in this EventExecutorGroup.
task
,
long
The positive initial delay for the first task execution, in terms of the given time unit.
initialDelay
,
long
The positive subsequent delay between task, to use after the first execution has completed, in terms of the given time unit.
delay
,
TimeUnit
The non-null time unit for the delays.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.scheduleWithFixedDelay.

Schedule the given task for periodic execution in the next available EventExecutor.
public Future<Void>
public Future<Void>
shutdownGracefully(long
the quiet period as described in the documentation
quietPeriod
,
long
the maximum amount of time to wait until the executor is shutting down regardless if a task was submitted during the quiet period.
timeout
,
TimeUnit
the unit of quietPeriod and timeout
unit
)

Implements io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down.
public Future<Void>
submit(Runnable
The task that should be executed in this EventExecutorGroup.
task
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.
public <T> Future<T>
submit(Runnable
The task that should be executed in this EventExecutorGroup.
task
,
T
The value that the returned future will complete with, if the task completes successfully.
result
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that produces the given result when the task completes.
public <T> Future<T>
submit(Callable<T>
The task that should be executed in this EventExecutorGroup.
task
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.
public Future<Void>
terminationFuture()

Implements io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.
private static EventExecutorGroup
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

groupback to summary
private final EventExecutorGroup group
maxTaskExecutePerRunback to summary
private final int maxTaskExecutePerRun

Constructor Detail

NonStickyEventExecutorGroupback to summary
public NonStickyEventExecutorGroup(EventExecutorGroup group)

Creates a new instance. Be aware that the given EventExecutorGroup MUST NOT contain any OrderedEventExecutors.

NonStickyEventExecutorGroupback to summary
public NonStickyEventExecutorGroup(EventExecutorGroup group, int maxTaskExecutePerRun)

Creates a new instance. Be aware that the given EventExecutorGroup MUST NOT contain any OrderedEventExecutors.

Method Detail

awaitTerminationback to summary
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException

Overrides default io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Doc from io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Wait for this EventExecutorGroup to terminate, up to the given timeout.

Parameters
timeout:long

The non-negative maximum amount of time to wait for the executor group to terminate.

unit:TimeUnit

The non-null time unit of the timeout.

Returns:boolean

true if the executor group terminated within the specific timeout.

Annotations
@Override
Exceptions
InterruptedException:
If this thread was interrupted while waiting for executor group to terminate.
executeback to summary
public void execute(Runnable task)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

Parameters
task:Runnable

the runnable task

Annotations
@Override
isShutdownback to summary
public boolean isShutdown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Returns true if all EventExecutors managed by this EventExecutorGroup have been shut down gracefully and moved past the grace period so that they are no longer accepting any new tasks.

An executor group that "is shut down" might still be executing tasks that it has queued up, but it will no longer be accepting any new tasks. Once all running and queued tasks have completed, the executor group will be terminated.

Returns:boolean

true if all executors in this group have shut down and are no longer accepting any new tasks.

Annotations
@Override
isShuttingDownback to summary
public boolean isShuttingDown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShuttingDown.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isShuttingDown.

Returns true if and only if all EventExecutors managed by this EventExecutorGroup are being shut down gracefully or was shut down.

An executor group that "is shutting down" can still accept new tasks for a little while (the grace period), but will eventually start rejecting new tasks. At that point, the executor group will be shut down.

Returns:boolean

true if all executors in this group have at least started shutting down, otherwise false.

Annotations
@Override
isTerminatedback to summary
public boolean isTerminated()

Overrides default io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Returns true if all EventExecutors managed by this EventExecutorGroup are shut down, and all of their tasks have completed.

Returns:boolean

true if all executors in this group have terminated.

Annotations
@Override
iteratorback to summary
public Iterator<EventExecutor> iterator()

Implements io.netty5.util.concurrent.EventExecutorGroup.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<EventExecutor>

an Iterator.

Annotations
@Override
newExecutorback to summary
private NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor newExecutor(EventExecutor executor)
nextback to summary
public EventExecutor next()

Implements io.netty5.util.concurrent.EventExecutorGroup.next.

Doc from io.netty5.util.concurrent.EventExecutorGroup.next.

Returns one of the EventExecutors managed by this EventExecutorGroup.

Annotations
@Override
scheduleback to summary
public Future<Void> schedule(Runnable task, long delay, TimeUnit unit)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.schedule.

Doc from io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.

Parameters
task:Runnable

The task that should be executed in this EventExecutorGroup after the given delay.

delay:long

A positive time delay, in the given time unit.

unit:TimeUnit

The non-null time unit for the delay.

Returns:Future<Void>

A future that represents the completion of the scheduled task.

Annotations
@Override
scheduleback to summary
public <V> Future<V> schedule(Callable<V> task, long delay, TimeUnit unit)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.schedule.

Doc from io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.

Parameters
<V>
The type of the future result.
task:Callable<V>

The task that should be executed in this EventExecutorGroup after the given delay.

delay:long

A positive time delay, in the given time unit.

unit:TimeUnit

The non-null time unit for the delay.

Returns:Future<V>

A future that represents the completion of the scheduled task.

Annotations
@Override
scheduleAtFixedRateback to summary
public Future<Void> scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.scheduleAtFixedRate.

Doc from io.netty5.util.concurrent.EventExecutorGroup.scheduleAtFixedRate.

Schedule the given task for periodic execution in the next available EventExecutor. The first execution will occur after the given initial delay, and the following repeated executions will occur with the given period of time between each execution is started. If the task takes longer to complete than the requested period, then the following executions will be delayed, rather than allowing multiple instances of the task to run concurrently.

The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.

Parameters
task:Runnable

The task that should be scheduled to execute at a fixed rate in this EventExecutorGroup.

initialDelay:long

The positive initial delay for the first task execution, in terms of the given time unit.

period:long

The positive period for the execution frequency to use after the first execution has started, in terms of the given time unit.

unit:TimeUnit

The non-null time unit for the delay and period.

Returns:Future<Void>

A future that represents the recurring task, and which can be cancelled to stop future executions.

Annotations
@Override
scheduleWithFixedDelayback to summary
public Future<Void> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.scheduleWithFixedDelay.

Doc from io.netty5.util.concurrent.EventExecutorGroup.scheduleWithFixedDelay.

Schedule the given task for periodic execution in the next available EventExecutor. The first execution will occur after the given initial delay, and the following repeated executions will occur with the given subsequent delay between one task completing and the next task starting. The delay from the completion of one task, to the start of the next, stays unchanged regardless of how long a task takes to complete.

This is in contrast to scheduleAtFixedRate(Runnable, long, long, TimeUnit) which varies the delays between the tasks in order to hit a given frequency.

The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.

Parameters
task:Runnable

The task that should be scheduled to execute with fixed delays in this EventExecutorGroup.

initialDelay:long

The positive initial delay for the first task execution, in terms of the given time unit.

delay:long

The positive subsequent delay between task, to use after the first execution has completed, in terms of the given time unit.

unit:TimeUnit

The non-null time unit for the delays.

Returns:Future<Void>

A future that represents the recurring task, and which can be cancelled to stop future executions.

Annotations
@Override
shutdownGracefullyback to summary
public Future<Void> shutdownGracefully()

Overrides default io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Doc from io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Shortcut method for shutdownGracefully(long, long, TimeUnit) with sensible default values.

Returns:Future<Void>

the terminationFuture()

Annotations
@Override
shutdownGracefullyback to summary
public Future<Void> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Doc from io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down. Once this method is called, isShuttingDown() starts to return true, and the executor prepares to shut itself down. This method 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.

Parameters
quietPeriod:long

the quiet period as described in the documentation

timeout:long

the maximum amount of time to wait until the executor is shutting down regardless if a task was submitted during the quiet period.

unit:TimeUnit

the unit of quietPeriod and timeout

Returns:Future<Void>

the terminationFuture()

Annotations
@Override
submitback to summary
public Future<Void> submit(Runnable task)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Doc from io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.

Parameters
task:Runnable

The task that should be executed in this EventExecutorGroup.

Returns:Future<Void>

A future that represents the completion of the submitted task.

Annotations
@Override
submitback to summary
public <T> Future<T> submit(Runnable task, T result)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Doc from io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that produces the given result when the task completes.

Parameters
<T>
The type of the future result.
task:Runnable

The task that should be executed in this EventExecutorGroup.

result:T

The value that the returned future will complete with, if the task completes successfully.

Returns:Future<T>

A future that represents the completion of the submitted task.

Annotations
@Override
submitback to summary
public <T> Future<T> submit(Callable<T> task)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.submit.

Doc from io.netty5.util.concurrent.EventExecutorGroup.submit.

Submit the given task for execution in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.

Parameters
<T>
The type of the future result.
task:Callable<T>

The task that should be executed in this EventExecutorGroup.

Returns:Future<T>

A future that represents the completion of the submitted task.

Annotations
@Override
terminationFutureback to summary
public Future<Void> terminationFuture()

Implements io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Doc from io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.

Returns:Future<Void>

The Future representing the termination of this EventExecutorGroup.

Annotations
@Override
verifyback to summary
private static EventExecutorGroup verify(EventExecutorGroup group)
io.netty5.util.concurrent back to summary

private final Class NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor

extends AbstractEventExecutor
implements Runnable, OrderedEventExecutor
Class Inheritance
All Implemented Interfaces
io.netty5.util.concurrent.OrderedEventExecutor, io.netty5.util.concurrent.EventExecutor, io.netty5.util.concurrent.FuturePromiseFactory, io.netty5.util.concurrent.EventExecutorGroup, java.util.concurrent.Executor, java.lang.Iterable, java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final EventExecutor
private final int
private static final int
private static final int
private final AtomicInteger
private static final int
private final Queue<Runnable>
Inherited from io.netty5.util.concurrent.AbstractEventExecutor:
DEFAULT_SHUTDOWN_QUIET_PERIODDEFAULT_SHUTDOWN_TIMEOUT

Constructor Summary

AccessConstructor and Description
pack-priv
NonStickyOrderedEventExecutor(EventExecutor executor, int maxTaskExecutePerRun)

Method Summary

Modifier and TypeMethod and Description
public boolean
awaitTermination(long
The non-negative maximum amount of time to wait for the executor group to terminate.
timeout
,
TimeUnit
The non-null time unit of the timeout.
unit
)

Overrides default io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Wait for this EventExecutorGroup to terminate, up to the given timeout.
public void
execute(Runnable
the runnable task
task
)

Implements io.netty5.util.concurrent.EventExecutor.execute.

Executes the given command at some time in the future.
public boolean
inEventLoop(Thread thread)

Implements io.netty5.util.concurrent.EventExecutor.inEventLoop.

Return true if the given Thread is executed in the event loop, false otherwise.
public boolean
isShutdown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Returns true if all EventExecutors managed by this EventExecutorGroup have been shut down gracefully and moved past the grace period so that they are no longer accepting any new tasks.
public boolean
public boolean
isTerminated()

Overrides default io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Returns true if all EventExecutors managed by this EventExecutorGroup are shut down, and all of their tasks have completed.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public Future<Void>
schedule(Runnable
The task that should be executed in this EventExecutorGroup after the given delay.
task
,
long
A positive time delay, in the given time unit.
delay
,
TimeUnit
The non-null time unit for the delay.
unit
)

Implements io.netty5.util.concurrent.EventExecutor.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.
public <V> Future<V>
schedule(Callable<V>
The task that should be executed in this EventExecutorGroup after the given delay.
task
,
long
A positive time delay, in the given time unit.
delay
,
TimeUnit
The non-null time unit for the delay.
unit
)

Implements io.netty5.util.concurrent.EventExecutor.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.
public Future<Void>
scheduleAtFixedRate(Runnable
The task that should be scheduled to execute at a fixed rate in this EventExecutorGroup.
task
,
long
The positive initial delay for the first task execution, in terms of the given time unit.
initialDelay
,
long
The positive period for the execution frequency to use after the first execution has started, in terms of the given time unit.
period
,
TimeUnit
The non-null time unit for the delay and period.
unit
)

Implements io.netty5.util.concurrent.EventExecutor.scheduleAtFixedRate.

Schedule the given task for periodic execution in the next available EventExecutor.
public Future<Void>
scheduleWithFixedDelay(Runnable
The task that should be scheduled to execute with fixed delays in this EventExecutorGroup.
task
,
long
The positive initial delay for the first task execution, in terms of the given time unit.
initialDelay
,
long
The positive subsequent delay between task, to use after the first execution has completed, in terms of the given time unit.
delay
,
TimeUnit
The non-null time unit for the delays.
unit
)

Implements io.netty5.util.concurrent.EventExecutor.scheduleWithFixedDelay.

Schedule the given task for periodic execution in the next available EventExecutor.
public Future<Void>
shutdownGracefully(long
the quiet period as described in the documentation
quietPeriod
,
long
the maximum amount of time to wait until the executor is shutting down regardless if a task was submitted during the quiet period.
timeout
,
TimeUnit
the unit of quietPeriod and timeout
unit
)

Implements io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down.
public Future<Void>
terminationFuture()

Implements io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.
Inherited from io.netty5.util.concurrent.AbstractEventExecutor:
newSucceededFuturenewTaskFornewTaskForsafeExecutesubmitsubmitsubmit

Field Detail

executorback to summary
private final EventExecutor executor
maxTaskExecutePerRunback to summary
private final int maxTaskExecutePerRun
NONEback to summary
private static final int NONE
RUNNINGback to summary
private static final int RUNNING
stateback to summary
private final AtomicInteger state
SUBMITTEDback to summary
private static final int SUBMITTED
tasksback to summary
private final Queue<Runnable> tasks

Constructor Detail

NonStickyOrderedEventExecutorback to summary
pack-priv NonStickyOrderedEventExecutor(EventExecutor executor, int maxTaskExecutePerRun)

Method Detail

awaitTerminationback to summary
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException

Overrides default io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Doc from io.netty5.util.concurrent.EventExecutorGroup.awaitTermination.

Wait for this EventExecutorGroup to terminate, up to the given timeout.

Parameters
timeout:long

The non-negative maximum amount of time to wait for the executor group to terminate.

unit:TimeUnit

The non-null time unit of the timeout.

Returns:boolean

true if the executor group terminated within the specific timeout.

Annotations
@Override
Exceptions
InterruptedException:
If this thread was interrupted while waiting for executor group to terminate.
executeback to summary
public void execute(Runnable task)

Implements io.netty5.util.concurrent.EventExecutor.execute.

Doc from java.util.concurrent.Executor.execute.

Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation.

Parameters
task:Runnable

the runnable task

Annotations
@Override
inEventLoopback to summary
public boolean inEventLoop(Thread thread)

Implements io.netty5.util.concurrent.EventExecutor.inEventLoop.

Doc from io.netty5.util.concurrent.EventExecutor.inEventLoop.

Return true if the given Thread is executed in the event loop, false otherwise.

Annotations
@Override
isShutdownback to summary
public boolean isShutdown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isShutdown.

Returns true if all EventExecutors managed by this EventExecutorGroup have been shut down gracefully and moved past the grace period so that they are no longer accepting any new tasks.

An executor group that "is shut down" might still be executing tasks that it has queued up, but it will no longer be accepting any new tasks. Once all running and queued tasks have completed, the executor group will be terminated.

Returns:boolean

true if all executors in this group have shut down and are no longer accepting any new tasks.

Annotations
@Override
isShuttingDownback to summary
public boolean isShuttingDown()

Implements io.netty5.util.concurrent.EventExecutorGroup.isShuttingDown.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isShuttingDown.

Returns true if and only if all EventExecutors managed by this EventExecutorGroup are being shut down gracefully or was shut down.

An executor group that "is shutting down" can still accept new tasks for a little while (the grace period), but will eventually start rejecting new tasks. At that point, the executor group will be shut down.

Returns:boolean

true if all executors in this group have at least started shutting down, otherwise false.

Annotations
@Override
isTerminatedback to summary
public boolean isTerminated()

Overrides default io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Doc from io.netty5.util.concurrent.EventExecutorGroup.isTerminated.

Returns true if all EventExecutors managed by this EventExecutorGroup are shut down, and all of their tasks have completed.

Returns:boolean

true if all executors in this group have terminated.

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
scheduleback to summary
public Future<Void> schedule(Runnable task, long delay, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutor.schedule.

Doc from io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that produces a null result when the task completes.

Parameters
task:Runnable

The task that should be executed in this EventExecutorGroup after the given delay.

delay:long

A positive time delay, in the given time unit.

unit:TimeUnit

The non-null time unit for the delay.

Returns:Future<Void>

A future that represents the completion of the scheduled task.

Annotations
@Override
scheduleback to summary
public <V> Future<V> schedule(Callable<V> task, long delay, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutor.schedule.

Doc from io.netty5.util.concurrent.EventExecutorGroup.schedule.

Schedule the given task for execution after the given delay, in the next available EventExecutor in this group, and return a future that will return the result of the callable when the task completes.

Parameters
<V>
The type of the future result.
task:Callable<V>

The task that should be executed in this EventExecutorGroup after the given delay.

delay:long

A positive time delay, in the given time unit.

unit:TimeUnit

The non-null time unit for the delay.

Returns:Future<V>

A future that represents the completion of the scheduled task.

Annotations
@Override
scheduleAtFixedRateback to summary
public Future<Void> scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutor.scheduleAtFixedRate.

Doc from io.netty5.util.concurrent.EventExecutorGroup.scheduleAtFixedRate.

Schedule the given task for periodic execution in the next available EventExecutor. The first execution will occur after the given initial delay, and the following repeated executions will occur with the given period of time between each execution is started. If the task takes longer to complete than the requested period, then the following executions will be delayed, rather than allowing multiple instances of the task to run concurrently.

The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.

Parameters
task:Runnable

The task that should be scheduled to execute at a fixed rate in this EventExecutorGroup.

initialDelay:long

The positive initial delay for the first task execution, in terms of the given time unit.

period:long

The positive period for the execution frequency to use after the first execution has started, in terms of the given time unit.

unit:TimeUnit

The non-null time unit for the delay and period.

Returns:Future<Void>

A future that represents the recurring task, and which can be cancelled to stop future executions.

Annotations
@Override
scheduleWithFixedDelayback to summary
public Future<Void> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutor.scheduleWithFixedDelay.

Doc from io.netty5.util.concurrent.EventExecutorGroup.scheduleWithFixedDelay.

Schedule the given task for periodic execution in the next available EventExecutor. The first execution will occur after the given initial delay, and the following repeated executions will occur with the given subsequent delay between one task completing and the next task starting. The delay from the completion of one task, to the start of the next, stays unchanged regardless of how long a task takes to complete.

This is in contrast to scheduleAtFixedRate(Runnable, long, long, TimeUnit) which varies the delays between the tasks in order to hit a given frequency.

The task will be executed repeatedly until it either fails with an exception, or its future is cancelled. The future thus will never complete successfully.

Parameters
task:Runnable

The task that should be scheduled to execute with fixed delays in this EventExecutorGroup.

initialDelay:long

The positive initial delay for the first task execution, in terms of the given time unit.

delay:long

The positive subsequent delay between task, to use after the first execution has completed, in terms of the given time unit.

unit:TimeUnit

The non-null time unit for the delays.

Returns:Future<Void>

A future that represents the recurring task, and which can be cancelled to stop future executions.

Annotations
@Override
shutdownGracefullyback to summary
public Future<Void> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)

Implements io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Doc from io.netty5.util.concurrent.EventExecutorGroup.shutdownGracefully.

Signals this executor that the caller wants the executor to be shut down. Once this method is called, isShuttingDown() starts to return true, and the executor prepares to shut itself down. This method 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.

Parameters
quietPeriod:long

the quiet period as described in the documentation

timeout:long

the maximum amount of time to wait until the executor is shutting down regardless if a task was submitted during the quiet period.

unit:TimeUnit

the unit of quietPeriod and timeout

Returns:Future<Void>

the terminationFuture()

Annotations
@Override
terminationFutureback to summary
public Future<Void> terminationFuture()

Implements io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Doc from io.netty5.util.concurrent.EventExecutorGroup.terminationFuture.

Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.

Returns:Future<Void>

The Future representing the termination of this EventExecutorGroup.

Annotations
@Override