public class PromiseAggregator<V,F extends Future<V>> extends Object implements GenericFutureListener<F>
GenericFutureListener
implementation which consolidates multiple Future
s
into one, by listening to individual Future
s and producing an aggregated result
(success/failure) when all Future
s have completed.Constructor and Description |
---|
PromiseAggregator(Promise<Void> aggregatePromise)
|
PromiseAggregator(Promise<Void> aggregatePromise,
boolean failPending)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
PromiseAggregator<V,F> |
add(Promise<V>... promises)
Add the given
Promise s to the aggregator. |
void |
operationComplete(F future)
Invoked when the operation associated with the
Future has been completed. |
public PromiseAggregator(Promise<Void> aggregatePromise, boolean failPending)
aggregatePromise
- the Promise
to notifyfailPending
- true
to fail pending promises, false to leave them unaffectedpublic PromiseAggregator(Promise<Void> aggregatePromise)
PromiseAggregator(Promise, boolean)
.
Defaults failPending
to true.@SafeVarargs public final PromiseAggregator<V,F> add(Promise<V>... promises)
Promise
s to the aggregator.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–2015 The Netty Project. All rights reserved.