Package io.netty.util.concurrent
Class FailedFuture<V>
java.lang.Object
io.netty.util.concurrent.AbstractFuture<V>
io.netty.util.concurrent.CompleteFuture<V>
io.netty.util.concurrent.FailedFuture<V>
The
CompleteFuture which is failed already. It is
recommended to use EventExecutor.newFailedFuture(Throwable)
instead of calling the constructor of this future.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFailedFuture(EventExecutor executor, Throwable cause) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the cause of the failed I/O operation if the I/O operation has failed.getNow()Return the result without blocking.booleanReturnstrueif and only if the I/O operation was completed successfully.sync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Waits for this future until it is done, and rethrows the cause of the failure if this future failed.Methods inherited from class io.netty.util.concurrent.CompleteFuture
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListenersMethods inherited from class io.netty.util.concurrent.AbstractFuture
get, getMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
cause
-
-
Constructor Details
-
FailedFuture
Creates a new instance.- Parameters:
executor- theEventExecutorassociated with this futurecause- the cause of failure
-
-
Method Details
-
cause
Description copied from interface:FutureReturns the cause of the failed I/O operation if the I/O operation has failed.- Returns:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()Description copied from interface:FutureReturnstrueif and only if the I/O operation was completed successfully. -
sync
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed. -
syncUninterruptibly
Description copied from interface:FutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptiblyin interfaceFuture<V>- Overrides:
syncUninterruptiblyin classCompleteFuture<V>
-
getNow
Description copied from interface:FutureReturn the result without blocking. If the future is not done yet this will returnnull.As it is possible that a
nullvalue is used to mark the future as successful you also need to check if the future is really done withFuture.isDone()and not rely on the returnednullvalue.
-