Top Description Methods
io.netty5.util.concurrent

pack-priv Interface AsynchronousResult<V>

Known Direct Subinterfaces
io.netty5.util.concurrent.Future, io.netty5.util.concurrent.FutureCompletionStage, io.netty5.util.concurrent.Promise
Imports
java.util.concurrent.CancellationException

A result of an asynchronous operation.

This interface is used as the super-interface of Promise and Future, and these should generally be used instead.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the operation was cancelled by this call, otherwise false.
cancel
()

Cancel this asynchronous operation, unless it has already been completed or is not cancellable.

public Throwable

Returns:

The cause of the failure, if any. Otherwise null if succeeded.
cause
()

Returns the cause of the failed operation if the operation has failed.

public EventExecutor
executor()

Returns the EventExecutor that is tied to this Promise or Future.

public V

Returns:

the result of this operation, if completed successfully.
getNow
()

Return the successful result of this asynchronous operation, if any.

public boolean

Returns:

true if this operation can be cancelled.
isCancellable
()

Returns true if and only if the operation can be cancelled via cancel().

public boolean

Returns:

true if this operation has been cancelled, otherwise false.
isCancelled
()

Return true if this operation has been cancelled.

public boolean

Returns:

true if this operation has completed, otherwise false.
isDone
()

Return true if this operation has been completed either successfully, unsuccessfully, or through cancellation.

public boolean
isFailed()

Returns true if and only if the operation was completed and failed.

public boolean
isSuccess()

Returns true if and only if the operation was completed successfully.

Method Detail

cancelback to summary
public boolean cancel()

Cancel this asynchronous operation, unless it has already been completed or is not cancellable.

A cancelled operation is considered to be done and failed.

If the cancellation was successful, the result of this operation will be that it has failed with a CancellationException.

Cancellation will not cause any threads working on the operation to be interrupted.

Returns:boolean

true if the operation was cancelled by this call, otherwise false.

causeback to summary
public Throwable cause()

Returns the cause of the failed operation if the operation has failed.

Returns:Throwable

The cause of the failure, if any. Otherwise null if succeeded.

Exceptions
IllegalStateException:
if this Promise has not completed yet.
executorback to summary
public EventExecutor executor()

Returns the EventExecutor that is tied to this Promise or Future.

getNowback to summary
public V getNow()

Return the successful result of this asynchronous operation, if any. If the operation has not yet been completed, then this will throw IllegalStateException. If the operation has been cancelled or failed with an exception, then this returns null. Note that asynchronous operations can also be completed successfully with a null result.

Returns:V

the result of this operation, if completed successfully.

Exceptions
IllegalStateException:
if this Future or Promise has not completed yet.
isCancellableback to summary
public boolean isCancellable()

Returns true if and only if the operation can be cancelled via cancel(). Note that this is inherently racy, as the operation could be made uncancellable at any time.

Returns:boolean

true if this operation can be cancelled.

isCancelledback to summary
public boolean isCancelled()

Return true if this operation has been cancelled.

Returns:boolean

true if this operation has been cancelled, otherwise false.

isDoneback to summary
public boolean isDone()

Return true if this operation has been completed either successfully, unsuccessfully, or through cancellation.

Returns:boolean

true if this operation has completed, otherwise false.

isFailedback to summary
public boolean isFailed()

Returns true if and only if the operation was completed and failed.

isSuccessback to summary
public boolean isSuccess()

Returns true if and only if the operation was completed successfully.