public interface CompositeFuture extends Future<CompositeFuture>
futures
, it is useful when several futures
needs to be coordinated.Modifier and Type | Method and Description |
---|---|
static <T1,T2> 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 <T1,T2,T3> CompositeFuture |
all(Future<T1> f1,
Future<T2> f2,
Future<T3> f3)
Like
all(Future, Future) but with 3 futures. |
static <T1,T2,T3,T4> |
all(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4)
Like
all(Future, Future) but with 4 futures. |
static <T1,T2,T3,T4,T5> |
all(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5)
Like
all(Future, Future) but with 5 futures. |
static <T1,T2,T3,T4,T5,T6> |
all(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5,
Future<T6> f6)
Like
all(Future, Future) but with 6 futures. |
static CompositeFuture |
all(List<Future> futures)
Like
all(Future, Future) but with a list of futures. |
static <T1,T2> 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 <T1,T2,T3> CompositeFuture |
any(Future<T1> f1,
Future<T2> f2,
Future<T3> f3)
Like
any(Future, Future) but with 3 futures. |
static <T1,T2,T3,T4> |
any(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4)
Like
any(Future, Future) but with 4 futures. |
static <T1,T2,T3,T4,T5> |
any(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5)
Like
any(Future, Future) but with 5 futures. |
static <T1,T2,T3,T4,T5,T6> |
any(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5,
Future<T6> f6)
Like
any(Future, Future) but with 6 futures. |
static CompositeFuture |
any(List<Future> futures)
Like
any(Future, Future) but with a list of futures. |
Throwable |
cause(int index)
Returns a cause of a wrapped future
|
boolean |
failed(int index)
Returns true if a wrapped future is failed
|
boolean |
isComplete(int index)
Returns true if a wrapped future is completed
|
<T> T |
result(int index)
Returns the result of a wrapped future
|
CompositeFuture |
setHandler(Handler<AsyncResult<CompositeFuture>> handler)
Set a handler for the result.
|
int |
size() |
boolean |
succeeded(int index)
Returns true if a wrapped future is succeeded
|
cause, complete, complete, completer, compose, fail, fail, failed, failedFuture, failedFuture, future, isComplete, result, succeeded, succeededFuture, succeededFuture
static <T1,T2> CompositeFuture all(Future<T1> f1, Future<T2> f2)
f1
- futuref2
- futurestatic <T1,T2,T3> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3)
all(Future, Future)
but with 3 futures.static <T1,T2,T3,T4> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
all(Future, Future)
but with 4 futures.static <T1,T2,T3,T4,T5> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
all(Future, Future)
but with 5 futures.static <T1,T2,T3,T4,T5,T6> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)
all(Future, Future)
but with 6 futures.static CompositeFuture all(List<Future> futures)
all(Future, Future)
but with a list of futures.static <T1,T2> CompositeFuture any(Future<T1> f1, Future<T2> f2)
f1
- futuref2
- futurestatic <T1,T2,T3> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3)
any(Future, Future)
but with 3 futures.static <T1,T2,T3,T4> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
any(Future, Future)
but with 4 futures.static <T1,T2,T3,T4,T5> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
any(Future, Future)
but with 5 futures.static <T1,T2,T3,T4,T5,T6> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)
any(Future, Future)
but with 6 futures.static CompositeFuture any(List<Future> futures)
any(Future, Future)
but with a list of futures.CompositeFuture setHandler(Handler<AsyncResult<CompositeFuture>> handler)
Future
If the future has already been completed it will be called immediately. Otherwise it will be called when the future is completed.
setHandler
in interface Future<CompositeFuture>
handler
- the Handler that will be called with the resultThrowable cause(int index)
index
- the wrapped future indexboolean succeeded(int index)
index
- the wrapped future indexboolean failed(int index)
index
- the wrapped future indexboolean isComplete(int index)
index
- the wrapped future index<T> T result(int index)
index
- the wrapped future indexint size()
Copyright © 2016. All rights reserved.