Top Description Methods
io.vertx.core

public Interface CompositeFuture

extends Future<CompositeFuture>
Known Direct Implementers
io.vertx.core.impl.future.CompositeFutureImpl
Imports
io.vertx.codegen.annotations.GenIgnore, io.vertx.core.impl.future.CompositeFutureImpl, java.util.ArrayList, .List

The composite future wraps a list of futures, 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

Modifier and TypeMethod and Description
public static <T1, T2> CompositeFuture

Returns:

the composite future
all
(Future<T1>
future
f1
,
Future<T2>
future
f2
)

Hides io.vertx.core.Future.all.

Deprecated instead use Future#all(Future, Future)

Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

public static <T1, T2, T3> CompositeFuture
all(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.all.

Deprecated instead use Future#all(Future, Future, Future)

Like all(Future, Future) but with 3 futures.

public static <T1, T2, T3, T4> CompositeFuture
all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 4 futures.

public static <T1, T2, T3, T4, T5> CompositeFuture
all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 5 futures.

public 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)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 6 futures.

public static CompositeFuture
all(List<Future<T>> futures)

Hides io.vertx.core.Future.all.

Deprecated instead use Future#all(List)

Like all(Future, Future) but with a list of futures.

public static <T1, T2> CompositeFuture

Returns:

the composite future
any
(Future<T1>
future
f1
,
Future<T2>
future
f2
)

Hides io.vertx.core.Future.any.

Deprecated instead use Future#any(Future, Future)

Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.

public static <T1, T2, T3> CompositeFuture
any(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.any.

Deprecated instead use Future#any(Future, Future, Future)

Like any(Future, Future) but with 3 futures.

public static <T1, T2, T3, T4> CompositeFuture
any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 4 futures.

public static <T1, T2, T3, T4, T5> CompositeFuture
any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 5 futures.

public 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)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 6 futures.

public static CompositeFuture
any(List<Future<T>> futures)

Hides io.vertx.core.Future.any.

Deprecated instead use Future#any(List)

Like any(Future, Future) but with a list of futures.

public Throwable
cause(int
the wrapped future index
index
)

Returns a cause of a wrapped future

public default List<Throwable>

Returns:

a list of all the eventual failure causes. If no future failed, returns a list of null values.
causes
()

public boolean
failed(int
the wrapped future index
index
)

Returns true if a wrapped future is failed

public boolean
isComplete(int
the wrapped future index
index
)

Returns true if a wrapped future is completed

public static <T1, T2> CompositeFuture

Returns:

the composite future
join
(Future<T1>
future
f1
,
Future<T2>
future
f2
)

Hides io.vertx.core.Future.join.

Deprecated instead use Future#join(Future, Future)

Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

public static <T1, T2, T3> CompositeFuture
join(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.join.

Deprecated instead use Future#join(Future, Future, Future)

Like join(Future, Future) but with 3 futures.

public static <T1, T2, T3, T4> CompositeFuture
join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 4 futures.

public static <T1, T2, T3, T4, T5> CompositeFuture
join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 5 futures.

public static <T1, T2, T3, T4, T5, T6> CompositeFuture
join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 6 futures.

public static CompositeFuture
join(List<Future<T>> futures)

Hides io.vertx.core.Future.join.

Deprecated instead use Future#join(List)

Like join(Future, Future) but with a list of futures.

public default <T> List<T>

Returns:

a list of the current completed values. If one future is not yet resolved or is failed, null will be used
list
()

public CompositeFuture
onComplete(Handler<AsyncResult<CompositeFuture>>
the handler that will be called with the result
handler
)

Redeclares io.vertx.core.Future.onComplete.

Add a handler to be notified of the result.

public default CompositeFuture
onFailure(Handler<Throwable>
the handler that will be called with the failed result
handler
)

Overrides default io.vertx.core.Future.onFailure.

Add a handler to be notified of the failed result.

public default CompositeFuture
onSuccess(Handler<CompositeFuture>
the handler that will be called with the succeeded result
handler
)

Overrides default io.vertx.core.Future.onSuccess.

Add a handler to be notified of the succeeded result.

public <T> T
resultAt(int
the wrapped future index
index
)

Returns the result of a wrapped future

public int

Returns:

the number of wrapped future
size
()

public boolean
succeeded(int
the wrapped future index
index
)

Returns true if a wrapped future is succeeded

Inherited from io.vertx.core.Future:
andThenawaitcausecomposecomposeeventuallyeventuallyexpectingfailedfailedFuturefailedFutureflatMapfromCompletionStagefromCompletionStagefutureisCompletemapmapmapEmptyonCompleteotherwiseotherwiseotherwiseEmptyrecoverresultsucceededsucceededFuturesucceededFuturetimeouttoCompletionStagetransform

Method Detail

allback to summary
public static <T1, T2> CompositeFuture all(Future<T1> f1, Future<T2> f2)

Hides io.vertx.core.Future.all.

Deprecated

instead use Future#all(Future, Future)

Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

The returned future fails as soon as one of f1 or f2 fails.

Parameters
f1:Future<T1>

future

f2:Future<T2>

future

Returns:CompositeFuture

the composite future

Annotations
@Deprecated
allback to summary
public static <T1, T2, T3> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.all.

Deprecated

instead use Future#all(Future, Future, Future)

Like all(Future, Future) but with 3 futures.

Annotations
@Deprecated
allback to summary
public static <T1, T2, T3, T4> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 4 futures.

Annotations
@Deprecated
allback to summary
public static <T1, T2, T3, T4, T5> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 5 futures.

Annotations
@Deprecated
allback to summary
public 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)

Hides io.vertx.core.Future.all.

Like all(Future, Future) but with 6 futures.

Annotations
@Deprecated
allback to summary
public static CompositeFuture all(List<Future<T>> futures)

Hides io.vertx.core.Future.all.

Deprecated

instead use Future#all(List)

Like all(Future, Future) but with a list of futures.

When the list is empty, the returned future will be already completed.

Annotations
@Deprecated
anyback to summary
public static <T1, T2> CompositeFuture any(Future<T1> f1, Future<T2> f2)

Hides io.vertx.core.Future.any.

Deprecated

instead use Future#any(Future, Future)

Return a composite future, succeeded when any futures is succeeded, failed when all futures are failed.

The returned future succeeds as soon as one of f1 or f2 succeeds.

Parameters
f1:Future<T1>

future

f2:Future<T2>

future

Returns:CompositeFuture

the composite future

Annotations
@Deprecated
anyback to summary
public static <T1, T2, T3> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.any.

Deprecated

instead use Future#any(Future, Future, Future)

Like any(Future, Future) but with 3 futures.

Annotations
@Deprecated
anyback to summary
public static <T1, T2, T3, T4> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 4 futures.

Annotations
@Deprecated
anyback to summary
public static <T1, T2, T3, T4, T5> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 5 futures.

Annotations
@Deprecated
anyback to summary
public 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)

Hides io.vertx.core.Future.any.

Like any(Future, Future) but with 6 futures.

Annotations
@Deprecated
anyback to summary
public static CompositeFuture any(List<Future<T>> futures)

Hides io.vertx.core.Future.any.

Deprecated

instead use Future#any(List)

Like any(Future, Future) but with a list of futures.

When the list is empty, the returned future will be already completed.

Annotations
@Deprecated
causeback to summary
public Throwable cause(int index)

Returns a cause of a wrapped future

Parameters
index:int

the wrapped future index

causesback to summary
public default List<Throwable> causes()
Returns:List<Throwable>

a list of all the eventual failure causes. If no future failed, returns a list of null values.

Annotations
@GenIgnore
failedback to summary
public boolean failed(int index)

Returns true if a wrapped future is failed

Parameters
index:int

the wrapped future index

isCompleteback to summary
public boolean isComplete(int index)

Returns true if a wrapped future is completed

Parameters
index:int

the wrapped future index

joinback to summary
public static <T1, T2> CompositeFuture join(Future<T1> f1, Future<T2> f2)

Hides io.vertx.core.Future.join.

Deprecated

instead use Future#join(Future, Future)

Return a composite future, succeeded when all futures are succeeded, failed when any future is failed.

It always wait until all its futures are completed and will not fail as soon as one of f1 or f2 fails.

Parameters
f1:Future<T1>

future

f2:Future<T2>

future

Returns:CompositeFuture

the composite future

Annotations
@Deprecated
joinback to summary
public static <T1, T2, T3> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3)

Hides io.vertx.core.Future.join.

Deprecated

instead use Future#join(Future, Future, Future)

Like join(Future, Future) but with 3 futures.

Annotations
@Deprecated
joinback to summary
public static <T1, T2, T3, T4> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 4 futures.

Annotations
@Deprecated
joinback to summary
public static <T1, T2, T3, T4, T5> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 5 futures.

Annotations
@Deprecated
joinback to summary
public static <T1, T2, T3, T4, T5, T6> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)

Hides io.vertx.core.Future.join.

Like join(Future, Future) but with 6 futures.

Annotations
@Deprecated
joinback to summary
public static CompositeFuture join(List<Future<T>> futures)

Hides io.vertx.core.Future.join.

Deprecated

instead use Future#join(List)

Like join(Future, Future) but with a list of futures.

When the list is empty, the returned future will be already completed.

Annotations
@Deprecated
listback to summary
public default <T> List<T> list()
Returns:List<T>

a list of the current completed values. If one future is not yet resolved or is failed, null will be used

Annotations
@GenIgnore
onCompleteback to summary
public CompositeFuture onComplete(Handler<AsyncResult<CompositeFuture>> handler)

Redeclares io.vertx.core.Future.onComplete.

Doc from io.vertx.core.Future.onComplete.

Add 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.

Parameters
handler:Handler<AsyncResult<CompositeFuture>>

the handler that will be called with the result

Returns:CompositeFuture

a reference to this, so it can be used fluently

Annotations
@Override
onFailureback to summary
public default CompositeFuture onFailure(Handler<Throwable> handler)

Overrides default io.vertx.core.Future.onFailure.

Doc from io.vertx.core.Future.onFailure.

Add 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.

Parameters
handler:Handler<Throwable>

the handler that will be called with the failed result

Returns:CompositeFuture

a reference to this, so it can be used fluently

Annotations
@Override
onSuccessback to summary
public default CompositeFuture onSuccess(Handler<CompositeFuture> handler)

Overrides default io.vertx.core.Future.onSuccess.

Doc from io.vertx.core.Future.onSuccess.

Add 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.

Parameters
handler:Handler<CompositeFuture>

the handler that will be called with the succeeded result

Returns:CompositeFuture

a reference to this, so it can be used fluently

Annotations
@Override
resultAtback to summary
public <T> T resultAt(int index)

Returns the result of a wrapped future

Parameters
index:int

the wrapped future index

sizeback to summary
public int size()
Returns:int

the number of wrapped future

succeededback to summary
public boolean succeeded(int index)

Returns true if a wrapped future is succeeded

Parameters
index:int

the wrapped future index