Package io.vertx.core
Interface CompositeFuture
-
- All Superinterfaces:
AsyncResult<CompositeFuture>,Future<CompositeFuture>
public interface CompositeFuture extends Future<CompositeFuture>
The composite future wraps a list offutures, it is useful when several futures needs to be coordinated. The handlers set for the coordinated futures are overridden by the handler of the composite future.- Author:
- Julien Viet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Throwablecause(int index)Returns a cause of a wrapped futuredefault List<Throwable>causes()booleanfailed(int index)Returns true if a wrapped future is failedbooleanisComplete(int index)Returns true if a wrapped future is completeddefault <T> List<T>list()CompositeFutureonComplete(Handler<AsyncResult<CompositeFuture>> handler)Add a handler to be notified of the result.default CompositeFutureonFailure(Handler<? super Throwable> handler)Add a handler to be notified of the failed result.default CompositeFutureonSuccess(Handler<? super CompositeFuture> handler)Add a handler to be notified of the succeeded result.<T> TresultAt(int index)Returns the result of a wrapped futureintsize()booleansucceeded(int index)Returns true if a wrapped future is succeeded-
Methods inherited from interface io.vertx.core.Future
andThen, andThen, await, await, cause, compose, compose, eventually, expecting, failed, flatMap, isComplete, map, map, mapEmpty, onComplete, onComplete, otherwise, otherwise, otherwiseEmpty, recover, result, succeeded, timeout, toCompletionStage, transform, transform
-
-
-
-
Method Detail
-
onComplete
CompositeFuture onComplete(Handler<AsyncResult<CompositeFuture>> handler)
Description copied from interface:FutureAdd a handler to be notified of the result.WARNING: this is a terminal operation. If several
handlers are registered, there is no guarantee that they will be invoked in order of registration.- Specified by:
onCompletein interfaceFuture<CompositeFuture>- Parameters:
handler- the handler that will be called with the result- Returns:
- a reference to this, so it can be used fluently
-
onSuccess
default CompositeFuture onSuccess(Handler<? super CompositeFuture> handler)
Description copied from interface:FutureAdd a handler to be notified of the succeeded result.WARNING: this is a terminal operation. If several
handlers are registered, there is no guarantee that they will be invoked in order of registration.- Specified by:
onSuccessin interfaceFuture<CompositeFuture>- Parameters:
handler- the handler that will be called with the succeeded result- Returns:
- a reference to this, so it can be used fluently
-
onFailure
default CompositeFuture onFailure(Handler<? super Throwable> handler)
Description copied from interface:FutureAdd a handler to be notified of the failed result.WARNING: this is a terminal operation. If several
handlers are registered, there is no guarantee that they will be invoked in order of registration.- Specified by:
onFailurein interfaceFuture<CompositeFuture>- Parameters:
handler- the handler that will be called with the failed result- Returns:
- a reference to this, so it can be used fluently
-
cause
Throwable cause(int index)
Returns a cause of a wrapped future- Parameters:
index- the wrapped future index
-
succeeded
boolean succeeded(int index)
Returns true if a wrapped future is succeeded- Parameters:
index- the wrapped future index
-
failed
boolean failed(int index)
Returns true if a wrapped future is failed- Parameters:
index- the wrapped future index
-
isComplete
boolean isComplete(int index)
Returns true if a wrapped future is completed- Parameters:
index- the wrapped future index
-
resultAt
<T> T resultAt(int index)
Returns the result of a wrapped future- Parameters:
index- the wrapped future index
-
size
int size()
- Returns:
- the number of wrapped future
-
list
default <T> List<T> list()
- Returns:
- a list of the current completed values. If one future is not yet resolved or is failed, null will be used
-
-