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

public final Class UnorderedThreadPoolEventExecutor

extends Object
implements EventExecutor
Class Inheritance
All Implemented Interfaces
io.netty5.util.concurrent.EventExecutor, io.netty5.util.concurrent.FuturePromiseFactory, io.netty5.util.concurrent.EventExecutorGroup, java.util.concurrent.Executor, java.lang.Iterable
Annotations
@SuppressWarnings:unchecked
Imports
io.netty5.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.util.concurrent.BlockingQueue, .Callable, .Delayed, .RejectedExecutionHandler, .RunnableScheduledFuture, .ScheduledThreadPoolExecutor, .ThreadFactory, .TimeUnit

EventExecutor implementation which makes no guarantees about the ordering of task execution that are submitted because there may be multiple threads executing these tasks. This implementation is most useful for protocols that do not need strict ordering. Because it provides no ordering care should be taken when using it!

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
UnorderedThreadPoolEventExecutor.RunnableScheduledFutureTask<V>

Note

this class has a natural ordering that is inconsistent with equals.

Field Summary

Modifier and TypeField and Description
private final UnorderedThreadPoolEventExecutor.InnerScheduledThreadPoolExecutor
private static final InternalLogger
private final Promise<Void>

Constructor Summary

AccessConstructor and Description
public
public
public
public

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.
pack-priv BlockingQueue<Runnable>

Returns:

The task queue of this executor.
getQueue
()

Return the task queue of the underlying java.util.concurrent.Executor instance.

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 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>
submit(Runnable
The task that should be executed in this EventExecutorGroup.
task
)

Implements io.netty5.util.concurrent.EventExecutor.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
)

Implements io.netty5.util.concurrent.EventExecutor.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
)

Implements io.netty5.util.concurrent.EventExecutor.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.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executorback to summary
private final UnorderedThreadPoolEventExecutor.InnerScheduledThreadPoolExecutor executor
loggerback to summary
private static final InternalLogger logger
terminationFutureback to summary
private final Promise<Void> terminationFuture

Constructor Detail

UnorderedThreadPoolEventExecutorback to summary
public UnorderedThreadPoolEventExecutor(int corePoolSize)

Calls UnorderedThreadPoolEventExecutor#UnorderedThreadPoolEventExecutor(int, ThreadFactory) using DefaultThreadFactory.

UnorderedThreadPoolEventExecutorback to summary
public UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory)

See ScheduledThreadPoolExecutor#ScheduledThreadPoolExecutor(int, ThreadFactory)

UnorderedThreadPoolEventExecutorback to summary
public UnorderedThreadPoolEventExecutor(int corePoolSize, RejectedExecutionHandler handler)

Calls UnorderedThreadPoolEventExecutor#UnorderedThreadPoolEventExecutor(int, ThreadFactory, java.util.concurrent.RejectedExecutionHandler) using DefaultThreadFactory.

UnorderedThreadPoolEventExecutorback to summary
public UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)

See ScheduledThreadPoolExecutor#ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)

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
getQueueback to summary
pack-priv BlockingQueue<Runnable> getQueue()

Return the task queue of the underlying java.util.concurrent.Executor instance.

Visible for testing.

Returns:BlockingQueue<Runnable>

The task queue of this executor.

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
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
submitback to summary
public Future<Void> submit(Runnable task)

Implements io.netty5.util.concurrent.EventExecutor.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)

Implements io.netty5.util.concurrent.EventExecutor.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)

Implements io.netty5.util.concurrent.EventExecutor.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
io.netty5.util.concurrent back to summary

private final Class UnorderedThreadPoolEventExecutor.InnerScheduledThreadPoolExecutor

extends ScheduledThreadPoolExecutor
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final EventExecutor

Constructor Summary

AccessConstructor and Description
pack-priv
InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory)

pack-priv
InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)

Method Summary

Modifier and TypeMethod and Description
protected <V> RunnableScheduledFuture<V>
decorateTask(Runnable
the submitted Runnable
runnable
,
RunnableScheduledFuture<V>
the task created to execute the runnable
task
)

Overrides java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Modifies or replaces the task used to execute a runnable.
protected <V> RunnableScheduledFuture<V>
decorateTask(Callable<V>
the submitted Callable
callable
,
RunnableScheduledFuture<V>
the task created to execute the callable
task
)

Overrides java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Modifies or replaces the task used to execute a callable.
Inherited from java.util.concurrent.ScheduledThreadPoolExecutor:
executegetContinueExistingPeriodicTasksAfterShutdownPolicygetExecuteExistingDelayedTasksAfterShutdownPolicygetQueuegetRemoveOnCancelPolicyscheduleschedulescheduleAtFixedRatescheduleWithFixedDelaysetContinueExistingPeriodicTasksAfterShutdownPolicysetExecuteExistingDelayedTasksAfterShutdownPolicysetRemoveOnCancelPolicyshutdownshutdownNowsubmitsubmitsubmit

Field Detail

eventExecutorback to summary
private final EventExecutor eventExecutor

Constructor Detail

InnerScheduledThreadPoolExecutorback to summary
pack-priv InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory)
InnerScheduledThreadPoolExecutorback to summary
pack-priv InnerScheduledThreadPoolExecutor(EventExecutor eventExecutor, int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler)

Method Detail

decorateTaskback to summary
protected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task)

Overrides java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Doc from java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Modifies or replaces the task used to execute a runnable. This method can be used to override the concrete class used for managing internal tasks. The default implementation simply returns the given task.

Parameters
<V>
the type of the task's result
runnable:Runnable

the submitted Runnable

task:RunnableScheduledFuture<V>

the task created to execute the runnable

Returns:RunnableScheduledFuture<V>

a task that can execute the runnable

Annotations
@Override
decorateTaskback to summary
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task)

Overrides java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Doc from java.util.concurrent.ScheduledThreadPoolExecutor.decorateTask.

Modifies or replaces the task used to execute a callable. This method can be used to override the concrete class used for managing internal tasks. The default implementation simply returns the given task.

Parameters
<V>
the type of the task's result
callable:Callable<V>

the submitted Callable

task:RunnableScheduledFuture<V>

the task created to execute the callable

Returns:RunnableScheduledFuture<V>

a task that can execute the callable

Annotations
@Override
io.netty5.util.concurrent back to summary

private final Class UnorderedThreadPoolEventExecutor.NonNotifyRunnable

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • io.netty5.util.concurrent.UnorderedThreadPoolEventExecutor.NonNotifyRunnable
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final Runnable

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

taskback to summary
private final Runnable task

Constructor Detail

NonNotifyRunnableback to summary
pack-priv NonNotifyRunnable(Runnable task)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.netty5.util.concurrent back to summary

private final Class UnorderedThreadPoolEventExecutor.RunnableScheduledFutureTask<V>

extends PromiseTask<V>
implements RunnableScheduledFuture<V>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.RunnableScheduledFuture, java.util.concurrent.ScheduledFuture, java.util.concurrent.Future, java.util.concurrent.Delayed, java.lang.Comparable, java.util.concurrent.RunnableFuture, java.lang.Runnable

Note

this class has a natural ordering that is inconsistent with equals.

Field Summary

Modifier and TypeField and Description
private final RunnableScheduledFuture<V>
Inherited from io.netty5.util.concurrent.PromiseTask:
task

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(Delayed
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
public long
getDelay(TimeUnit
the time unit
unit
)

Implements java.util.concurrent.Delayed.getDelay.

Returns the remaining delay associated with this object, in the given time unit.
public boolean
isPeriodic()

Implements java.util.concurrent.RunnableScheduledFuture.isPeriodic.

Returns true if this task is periodic.
public void
run()

Overrides io.netty5.util.concurrent.PromiseTask.run.

Implements java.util.concurrent.RunnableFuture.run.

Sets this Future to the result of its computation unless it has been cancelled.
Inherited from io.netty5.util.concurrent.PromiseTask:
cancelequalshashCodesetFailuresetFailureInternalsetSuccesssetSuccessInternalsetUncancellablesetUncancellableInternaltoCallabletoStringBuildertryFailuretryFailureInternaltrySuccess

Field Detail

futureback to summary
private final RunnableScheduledFuture<V> future

Constructor Detail

RunnableScheduledFutureTaskback to summary
pack-priv RunnableScheduledFutureTask(EventExecutor executor, Runnable runnable, RunnableScheduledFuture<V> future)
RunnableScheduledFutureTaskback to summary
pack-priv RunnableScheduledFutureTask(EventExecutor executor, Callable<V> callable, RunnableScheduledFuture<V> future)

Method Detail

compareToback to summary
public int compareTo(Delayed o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:Delayed

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
getDelayback to summary
public long getDelay(TimeUnit unit)

Implements java.util.concurrent.Delayed.getDelay.

Doc from java.util.concurrent.Delayed.getDelay.

Returns the remaining delay associated with this object, in the given time unit.

Parameters
unit:TimeUnit

the time unit

Returns:long

the remaining delay; zero or negative values indicate that the delay has already elapsed

Annotations
@Override
isPeriodicback to summary
public boolean isPeriodic()

Implements java.util.concurrent.RunnableScheduledFuture.isPeriodic.

Doc from java.util.concurrent.RunnableScheduledFuture.isPeriodic.

Returns true if this task is periodic. A periodic task may re-run according to some schedule. A non-periodic task can be run only once.

Returns:boolean

true if this task is periodic

Annotations
@Override
runback to summary
public void run()

Overrides io.netty5.util.concurrent.PromiseTask.run.

Implements java.util.concurrent.RunnableFuture.run.

Doc from java.util.concurrent.RunnableFuture.run.

Sets this Future to the result of its computation unless it has been cancelled.

Annotations
@Override