V
- the type of value returned by the futureF
- the type of futurepublic class PromiseNotifier<V,F extends Future<V>> extends Object implements GenericFutureListener<F>
GenericFutureListener
implementation which takes other Promise
s
and notifies them on completion.Constructor and Description |
---|
PromiseNotifier(boolean logNotifyFailure,
Promise<? super V>... promises)
Create a new instance.
|
PromiseNotifier(Promise<? super V>... promises)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
static <V,F extends Future<V>> |
cascade(boolean logNotifyFailure,
F future,
Promise<? super V> promise)
|
static <V,F extends Future<V>> |
cascade(F future,
Promise<? super V> promise)
|
void |
operationComplete(F future)
Invoked when the operation associated with the
Future has been completed. |
@SafeVarargs public PromiseNotifier(Promise<? super V>... promises)
promises
- the Promise
s to notify once this GenericFutureListener
is notified.@SafeVarargs public PromiseNotifier(boolean logNotifyFailure, Promise<? super V>... promises)
logNotifyFailure
- true
if logging should be done in case notification fails.promises
- the Promise
s to notify once this GenericFutureListener
is notified.public static <V,F extends Future<V>> F cascade(boolean logNotifyFailure, F future, Promise<? super V> promise)
Future
and Promise
such that if the Future
completes the Promise
will be notified. Cancellation is propagated both ways such that if the Future
is cancelled
the Promise
is cancelled and vise-versa.V
- the type of the value.F
- the type of the Future
logNotifyFailure
- true
if logging should be done in case notification fails.future
- the Future
which will be used to listen to for notifying the Promise
.promise
- the Promise
which will be notifiedFuture
public void operationComplete(F future) throws Exception
GenericFutureListener
Future
has been completed.operationComplete
in interface GenericFutureListener<F extends Future<V>>
future
- the source Future
which called this callbackException
Copyright © 2008–2024 The Netty Project. All rights reserved.