Package io.vertx.mutiny.core
Class CompositeFuture
- java.lang.Object
-
- io.vertx.mutiny.core.Future<CompositeFuture>
-
- io.vertx.mutiny.core.CompositeFuture
-
public class 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. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<CompositeFuture>__TYPE_ARG-
Fields inherited from class io.vertx.mutiny.core.Future
__typeArg_0
-
-
Constructor Summary
Constructors Constructor Description CompositeFuture(io.vertx.core.CompositeFuture delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T1,T2>
CompositeFutureall(Future<T1> f1, Future<T2> f2)static <T1,T2,T3>
CompositeFutureall(Future<T1> f1, Future<T2> f2, Future<T3> f3)static <T1,T2,T3,T4>
CompositeFutureall(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)static <T1,T2,T3,T4,T5>
CompositeFutureall(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)static <T1,T2,T3,T4,T5,T6>
CompositeFutureall(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)static CompositeFutureall(List<Future> futures)static <T1,T2>
CompositeFutureany(Future<T1> f1, Future<T2> f2)static <T1,T2,T3>
CompositeFutureany(Future<T1> f1, Future<T2> f2, Future<T3> f3)static <T1,T2,T3,T4>
CompositeFutureany(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)static <T1,T2,T3,T4,T5>
CompositeFutureany(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)static <T1,T2,T3,T4,T5,T6>
CompositeFutureany(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)static CompositeFutureany(List<Future> futures)Throwablecause(int index)voidcomplete()voidcomplete(CompositeFuture result)Deprecated.io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>>completer()Deprecated.<U> Future<U>compose(Function<CompositeFuture,Future<U>> mapper)<U> Future<U>compose(Function<CompositeFuture,Future<U>> successMapper, Function<Throwable,Future<U>> failureMapper)booleanequals(Object o)booleanfailed(int index)<U> Future<U>flatMap(Function<CompositeFuture,Future<U>> mapper)io.vertx.core.CompositeFuturegetDelegate()inthashCode()booleanisComplete(int index)static <T1,T2>
CompositeFuturejoin(Future<T1> f1, Future<T2> f2)static <T1,T2,T3>
CompositeFuturejoin(Future<T1> f1, Future<T2> f2, Future<T3> f3)static <T1,T2,T3,T4>
CompositeFuturejoin(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)static <T1,T2,T3,T4,T5>
CompositeFuturejoin(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)static <T1,T2,T3,T4,T5,T6>
CompositeFuturejoin(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5, Future<T6> f6)static CompositeFuturejoin(List<Future> futures)<U> Future<U>map(Function<CompositeFuture,U> mapper)static CompositeFuturenewInstance(io.vertx.core.CompositeFuture arg)io.smallrye.mutiny.Uni<CompositeFuture>onComplete()Add a handler to be notified of the result.CompositeFutureonCompleteAndAwait()Blocking variant ofFuture.onComplete().CompositeFutureonFailure(Consumer<Throwable> handler)CompositeFutureonSuccess(Consumer<CompositeFuture> handler)Future<CompositeFuture>otherwise(CompositeFuture value)Future<CompositeFuture>otherwise(Function<Throwable,CompositeFuture> mapper)Future<CompositeFuture>otherwiseEmpty()Future<CompositeFuture>recover(Function<Throwable,Future<CompositeFuture>> mapper)CompositeFutureresult()<T> TresultAt(int index)io.smallrye.mutiny.Uni<CompositeFuture>setHandler()Deprecated.CompositeFuturesetHandlerAndAwait()Deprecated.intsize()booleansucceeded(int index)StringtoString()booleantryComplete()booleantryComplete(CompositeFuture result)Deprecated.-
Methods inherited from class io.vertx.mutiny.core.Future
cause, fail, fail, failed, failedFuture, failedFuture, future, future, isComplete, map, mapEmpty, newInstance, newInstance, succeeded, succeededFuture, succeededFuture, tryFail, tryFail
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<CompositeFuture> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.core.CompositeFuture getDelegate()
- Overrides:
getDelegatein classFuture<CompositeFuture>
-
toString
public String toString()
- Overrides:
toStringin classFuture<CompositeFuture>
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classFuture<CompositeFuture>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classFuture<CompositeFuture>
-
complete
@Deprecated public void complete(CompositeFuture result)
Deprecated.- Overrides:
completein classFuture<CompositeFuture>- Parameters:
result- the result
-
tryComplete
@Deprecated public boolean tryComplete(CompositeFuture result)
Deprecated.- Overrides:
tryCompletein classFuture<CompositeFuture>- Parameters:
result- the result- Returns:
- false when the future is already completed
-
result
public CompositeFuture result()
- Overrides:
resultin classFuture<CompositeFuture>- Returns:
- the result or null if the operation failed.
-
flatMap
public <U> Future<U> flatMap(Function<CompositeFuture,Future<U>> mapper)
- Overrides:
flatMapin classFuture<CompositeFuture>- Parameters:
mapper-- Returns:
-
compose
public <U> Future<U> compose(Function<CompositeFuture,Future<U>> mapper)
- Overrides:
composein classFuture<CompositeFuture>- Parameters:
mapper- the mapper function- Returns:
- the composed future
-
compose
public <U> Future<U> compose(Function<CompositeFuture,Future<U>> successMapper, Function<Throwable,Future<U>> failureMapper)
- Overrides:
composein classFuture<CompositeFuture>- Parameters:
successMapper- the function mapping the successfailureMapper- the function mapping the failure- Returns:
- the composed future
-
map
public <U> Future<U> map(Function<CompositeFuture,U> mapper)
- Overrides:
mapin classFuture<CompositeFuture>- Parameters:
mapper- the mapper function- Returns:
- the mapped future
-
completer
@Deprecated public io.vertx.core.Handler<io.vertx.core.AsyncResult<CompositeFuture>> completer()
Deprecated.- Overrides:
completerin classFuture<CompositeFuture>- Returns:
- an handler completing this future
-
recover
public Future<CompositeFuture> recover(Function<Throwable,Future<CompositeFuture>> mapper)
- Overrides:
recoverin classFuture<CompositeFuture>- Parameters:
mapper- A function which takes the exception of a failure and returns a new future.- Returns:
- A recovered future
-
otherwise
public Future<CompositeFuture> otherwise(Function<Throwable,CompositeFuture> mapper)
- Overrides:
otherwisein classFuture<CompositeFuture>- Parameters:
mapper- the mapper function- Returns:
- the mapped future
-
otherwise
public Future<CompositeFuture> otherwise(CompositeFuture value)
- Overrides:
otherwisein classFuture<CompositeFuture>- Parameters:
value- the value that eventually completes the mapped future- Returns:
- the mapped future
-
otherwiseEmpty
public Future<CompositeFuture> otherwiseEmpty()
- Overrides:
otherwiseEmptyin classFuture<CompositeFuture>- Returns:
- the mapped future
-
all
public static <T1,T2> CompositeFuture all(Future<T1> f1, Future<T2> f2)
- Parameters:
f1- futuref2- future- Returns:
- the composite future
-
all
public static <T1,T2,T3> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3)
- Parameters:
f1-f2-f3-- Returns:
-
all
public static <T1,T2,T3,T4> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
- Parameters:
f1-f2-f3-f4-- Returns:
-
all
public static <T1,T2,T3,T4,T5> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
- Parameters:
f1-f2-f3-f4-f5-- Returns:
-
all
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)
- Parameters:
f1-f2-f3-f4-f5-f6-- Returns:
-
all
public static CompositeFuture all(List<Future> futures)
- Parameters:
futures-- Returns:
-
any
public static <T1,T2> CompositeFuture any(Future<T1> f1, Future<T2> f2)
- Parameters:
f1- futuref2- future- Returns:
- the composite future
-
any
public static <T1,T2,T3> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3)
- Parameters:
f1-f2-f3-- Returns:
-
any
public static <T1,T2,T3,T4> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
- Parameters:
f1-f2-f3-f4-- Returns:
-
any
public static <T1,T2,T3,T4,T5> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
- Parameters:
f1-f2-f3-f4-f5-- Returns:
-
any
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)
- Parameters:
f1-f2-f3-f4-f5-f6-- Returns:
-
any
public static CompositeFuture any(List<Future> futures)
- Parameters:
futures-- Returns:
-
join
public static <T1,T2> CompositeFuture join(Future<T1> f1, Future<T2> f2)
- Parameters:
f1- futuref2- future- Returns:
- the composite future
-
join
public static <T1,T2,T3> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3)
- Parameters:
f1-f2-f3-- Returns:
-
join
public static <T1,T2,T3,T4> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
- Parameters:
f1-f2-f3-f4-- Returns:
-
join
public static <T1,T2,T3,T4,T5> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
- Parameters:
f1-f2-f3-f4-f5-- Returns:
-
join
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)
- Parameters:
f1-f2-f3-f4-f5-f6-- Returns:
-
join
public static CompositeFuture join(List<Future> futures)
- Parameters:
futures-- Returns:
-
setHandler
@Deprecated public io.smallrye.mutiny.Uni<CompositeFuture> setHandler()
Deprecated.Description copied from class:FutureLikeFuture.onComplete().Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Overrides:
setHandlerin classFuture<CompositeFuture>- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
setHandlerAndAwait
@Deprecated public CompositeFuture setHandlerAndAwait()
Deprecated.Description copied from class:FutureBlocking variant ofFuture.setHandler().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Overrides:
setHandlerAndAwaitin classFuture<CompositeFuture>- Returns:
- the T instance produced by the operation
-
onComplete
public io.smallrye.mutiny.Uni<CompositeFuture> onComplete()
Description copied from class:FutureAdd a handler to be notified of the result.
Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Overrides:
onCompletein classFuture<CompositeFuture>- Returns:
- a reference to this, so it can be used fluently
-
onCompleteAndAwait
public CompositeFuture onCompleteAndAwait()
Description copied from class:FutureBlocking variant ofFuture.onComplete().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Overrides:
onCompleteAndAwaitin classFuture<CompositeFuture>- Returns:
- a reference to this, so it can be used fluently
-
onSuccess
public CompositeFuture onSuccess(Consumer<CompositeFuture> handler)
- Overrides:
onSuccessin classFuture<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
public CompositeFuture onFailure(Consumer<Throwable> handler)
- Overrides:
onFailurein classFuture<CompositeFuture>- Parameters:
handler- the handler that will be called with the failed result- Returns:
- a reference to this, so it can be used fluently
-
complete
public void complete()
- Overrides:
completein classFuture<CompositeFuture>
-
tryComplete
public boolean tryComplete()
- Overrides:
tryCompletein classFuture<CompositeFuture>- Returns:
- false when the future is already completed
-
cause
public Throwable cause(int index)
- Parameters:
index- the wrapped future index- Returns:
-
succeeded
public boolean succeeded(int index)
- Parameters:
index- the wrapped future index- Returns:
-
failed
public boolean failed(int index)
- Parameters:
index- the wrapped future index- Returns:
-
isComplete
public boolean isComplete(int index)
- Parameters:
index- the wrapped future index- Returns:
-
resultAt
public <T> T resultAt(int index)
- Parameters:
index- the wrapped future index- Returns:
-
size
public int size()
- Returns:
- the number of wrapped future
-
newInstance
public static CompositeFuture newInstance(io.vertx.core.CompositeFuture arg)
-
-