public interface ChannelPromise extends ChannelFuture, Promise<Void>
ChannelFuture
which is writable.Modifier and Type | Method and Description |
---|---|
ChannelPromise |
addListener(GenericFutureListener<? extends Future<? super Void>> listener)
Adds the specified listener to this future.
|
ChannelPromise |
addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
Adds the specified listeners to this future.
|
ChannelPromise |
await()
Waits for this future to be completed.
|
ChannelPromise |
awaitUninterruptibly()
Waits for this future to be completed without
interruption.
|
Channel |
channel()
Returns a channel where the I/O operation associated with this
future takes place.
|
ChannelPromise |
removeListener(GenericFutureListener<? extends Future<? super Void>> listener)
Removes the first occurrence of the specified listener from this future.
|
ChannelPromise |
removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
ChannelPromise |
setFailure(Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
ChannelPromise |
setSuccess() |
ChannelPromise |
setSuccess(Void result)
Marks this future as a success and notifies all
listeners.
|
ChannelPromise |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
ChannelPromise |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
trySuccess() |
ChannelPromise |
unvoid()
|
isVoid
setUncancellable, tryFailure, trySuccess
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
get, get, isCancelled, isDone
Channel channel()
ChannelFuture
channel
in interface ChannelFuture
ChannelPromise setSuccess(Void result)
Promise
IllegalStateException
.setSuccess
in interface Promise<Void>
ChannelPromise setSuccess()
boolean trySuccess()
ChannelPromise setFailure(Throwable cause)
Promise
IllegalStateException
.setFailure
in interface Promise<Void>
ChannelPromise addListener(GenericFutureListener<? extends Future<? super Void>> listener)
Future
addListener
in interface ChannelFuture
addListener
in interface Promise<Void>
ChannelPromise addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
Future
addListeners
in interface ChannelFuture
addListeners
in interface Promise<Void>
ChannelPromise removeListener(GenericFutureListener<? extends Future<? super Void>> listener)
Future
removeListener
in interface ChannelFuture
removeListener
in interface Promise<Void>
ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)
Future
removeListeners
in interface ChannelFuture
removeListeners
in interface Promise<Void>
ChannelPromise sync() throws InterruptedException
Future
sync
in interface ChannelFuture
sync
in interface Promise<Void>
InterruptedException
ChannelPromise syncUninterruptibly()
Future
syncUninterruptibly
in interface ChannelFuture
syncUninterruptibly
in interface Promise<Void>
ChannelPromise await() throws InterruptedException
Future
await
in interface ChannelFuture
await
in interface Promise<Void>
InterruptedException
- if the current thread was interruptedChannelPromise awaitUninterruptibly()
Future
InterruptedException
and
discards it silently.awaitUninterruptibly
in interface ChannelFuture
awaitUninterruptibly
in interface Promise<Void>
ChannelPromise unvoid()
Copyright © 2008–2024 The Netty Project. All rights reserved.