The composite future wraps a list of futures, it is useful when several futures needs to be coordinated.
Constructor and description |
---|
CompositeFuture
(java.lang.Object delegate) |
Type | Name and description |
---|---|
static CompositeFuture |
all(Future<T1> f1, Future<T2> f2) Return a composite future, succeeded when all futures are succeeded, failed when any future is failed. |
static CompositeFuture |
all(Future<T1> f1, Future<T2> f2, Future<T3> f3) Like CompositeFuture.all but with 3 futures. |
static CompositeFuture |
all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4) Like CompositeFuture.all but with 4 futures. |
static CompositeFuture |
all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5) Like CompositeFuture.all but with 5 futures. |
static CompositeFuture |
all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6) Like CompositeFuture.all but with 6 futures. |
static CompositeFuture |
all(java.util.List<Future> futures) Like CompositeFuture.all but with a list of futures. |
static CompositeFuture |
any(Future<T1> f1, Future<T2> f2) Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed. |
static CompositeFuture |
any(Future<T1> f1, Future<T2> f2, Future<T3> f3) Like CompositeFuture.any but with 3 futures. |
static CompositeFuture |
any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4) Like CompositeFuture.any but with 4 futures. |
static CompositeFuture |
any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5) Like CompositeFuture.any but with 5 futures. |
static CompositeFuture |
any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6) Like CompositeFuture.any but with 6 futures. |
static CompositeFuture |
any(java.util.List<Future> futures) Like CompositeFuture.any but with a list of futures. |
java.lang.Throwable |
cause(int index) Returns a cause of a wrapped future |
boolean |
failed(int index) Returns true if a wrapped future is failed |
java.lang.Object |
getDelegate() |
boolean |
isComplete(int index) Returns true if a wrapped future is completed |
T |
result(int index) Returns the result of a wrapped future |
CompositeFuture |
setHandler(io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>> handler) |
int |
size() @return
|
boolean |
succeeded(int index) Returns true if a wrapped future is succeeded |
Methods inherited from class | Name |
---|---|
class Future |
cause, complete, complete, completer, compose, compose, fail, fail, failed, failedFuture, future, getDelegate, isComplete, map, map, result, setHandler, succeeded, succeededFuture, succeededFuture |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.
The returned future fails as soon as one off1
or f2
fails.
f1
- futuref2
- futureLike CompositeFuture.all but with 3 futures.
Like CompositeFuture.all but with 4 futures.
Like CompositeFuture.all but with 5 futures.
Like CompositeFuture.all but with 6 futures.
Like CompositeFuture.all but with a list of futures.
When the list is empty, the returned future will be already completed.
Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.
The returned future succeeds as soon as one off1
or f2
succeeds.
f1
- futuref2
- futureLike CompositeFuture.any but with 3 futures.
Like CompositeFuture.any but with 4 futures.
Like CompositeFuture.any but with 5 futures.
Like CompositeFuture.any but with 6 futures.
Like CompositeFuture.any but with a list of futures.
When the list is empty, the returned future will be already completed.
Returns a cause of a wrapped future
index
- the wrapped future indexReturns true if a wrapped future is failed
index
- the wrapped future indexReturns true if a wrapped future is completed
index
- the wrapped future indexReturns the result of a wrapped future
index
- the wrapped future index
Returns true if a wrapped future is succeeded
index
- the wrapped future index