public class CompositeFuture extends Future<CompositeFuture>
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.
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<CompositeFuture> |
__TYPE_ARG |
__typeArg_0
Constructor and Description |
---|
CompositeFuture(CompositeFuture delegate) |
CompositeFuture(Object delegate) |
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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 3 futures. |
static <T1,T2,T3,T4> |
all(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4)
Like
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) 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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) 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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 6 futures. |
static CompositeFuture |
all(List<Future> futures)
Like
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) 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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 3 futures. |
static <T1,T2,T3,T4> |
any(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4)
Like
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) 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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) 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(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 6 futures. |
static CompositeFuture |
any(List<Future> futures)
Like
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with a list of futures. |
Throwable |
cause(int index)
Returns a cause of a wrapped future
|
void |
complete()
Set this instance as result.
|
void |
complete(CompositeFuture result)
Deprecated.
|
Handler<AsyncResult<CompositeFuture>> |
completer()
Deprecated.
|
<U> Future<U> |
compose(java.util.function.Function<CompositeFuture,Future<U>> mapper)
Compose this future with a
mapper function. |
<U> Future<U> |
compose(java.util.function.Function<CompositeFuture,Future<U>> successMapper,
java.util.function.Function<Throwable,Future<U>> failureMapper)
Compose this future with a
successMapper and failureMapper functions. |
boolean |
equals(Object o) |
boolean |
failed(int index)
Returns true if a wrapped future is failed
|
<U> Future<U> |
flatMap(java.util.function.Function<CompositeFuture,Future<U>> mapper)
|
CompositeFuture |
getDelegate() |
int |
hashCode() |
boolean |
isComplete(int index)
Returns true if a wrapped future is completed
|
static <T1,T2> CompositeFuture |
join(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 |
join(Future<T1> f1,
Future<T2> f2,
Future<T3> f3)
Like
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 3 futures. |
static <T1,T2,T3,T4> |
join(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4)
Like
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 4 futures. |
static <T1,T2,T3,T4,T5> |
join(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5)
Like
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 5 futures. |
static <T1,T2,T3,T4,T5,T6> |
join(Future<T1> f1,
Future<T2> f2,
Future<T3> f3,
Future<T4> f4,
Future<T5> f5,
Future<T6> f6)
Like
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with 6 futures. |
static CompositeFuture |
join(List<Future> futures)
Like
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>) but with a list of futures. |
<U> Future<U> |
map(java.util.function.Function<CompositeFuture,U> mapper)
Apply a
mapper function on this future. |
static CompositeFuture |
newInstance(CompositeFuture arg) |
CompositeFuture |
onComplete(Handler<AsyncResult<CompositeFuture>> handler)
Add a handler to be notified of the result.
|
Observable<CompositeFuture> |
onCompleteObservable()
Deprecated.
|
CompositeFuture |
onFailure(Handler<Throwable> handler)
Add a handler to be notified of the failed result.
|
CompositeFuture |
onSuccess(Handler<CompositeFuture> handler)
Add a handler to be notified of the succeeded result.
|
Future<CompositeFuture> |
otherwise(CompositeFuture value)
Map the failure of a future to a specific
value . |
Future<CompositeFuture> |
otherwise(java.util.function.Function<Throwable,CompositeFuture> mapper)
Apply a
mapper function on this future. |
Future<CompositeFuture> |
otherwiseEmpty()
Map the failure of a future to
null . |
Future<CompositeFuture> |
recover(java.util.function.Function<Throwable,Future<CompositeFuture>> mapper)
Handles a failure of this Future by returning the result of another Future.
|
CompositeFuture |
result()
The result of the operation.
|
<T> T |
resultAt(int index)
Returns the result of a wrapped future
|
Single<CompositeFuture> |
rxOnComplete()
Add a handler to be notified of the result.
|
Single<CompositeFuture> |
rxSetHandler()
Deprecated.
|
CompositeFuture |
setHandler(Handler<AsyncResult<CompositeFuture>> handler)
Deprecated.
|
Observable<CompositeFuture> |
setHandlerObservable()
Deprecated.
|
int |
size() |
boolean |
succeeded(int index)
Returns true if a wrapped future is succeeded
|
String |
toString() |
boolean |
tryComplete()
Try to set this instance as result.
|
boolean |
tryComplete(CompositeFuture result)
Deprecated.
|
cause, fail, fail, failed, failedFuture, failedFuture, future, future, isComplete, map, mapEmpty, newInstance, newInstance, succeeded, succeededFuture, succeededFuture, tryFail, tryFail
public static final io.vertx.lang.rx.TypeArg<CompositeFuture> __TYPE_ARG
public CompositeFuture(CompositeFuture delegate)
public CompositeFuture(Object delegate)
public String toString()
toString
in class Future<CompositeFuture>
public boolean equals(Object o)
equals
in class Future<CompositeFuture>
public int hashCode()
hashCode
in class Future<CompositeFuture>
public CompositeFuture getDelegate()
getDelegate
in class Future<CompositeFuture>
@Deprecated public void complete(CompositeFuture result)
complete
in class Future<CompositeFuture>
result
- the result@Deprecated public boolean tryComplete(CompositeFuture result)
tryComplete
in class Future<CompositeFuture>
result
- the resultpublic CompositeFuture result()
result
in class Future<CompositeFuture>
public <U> Future<U> flatMap(java.util.function.Function<CompositeFuture,Future<U>> mapper)
flatMap
in class Future<CompositeFuture>
mapper
- public <U> Future<U> compose(java.util.function.Function<CompositeFuture,Future<U>> mapper)
mapper
function.
When this future (the one on which compose
is called) succeeds, the mapper
will be called with
the completed value and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
If the mapper
throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
compose
in class Future<CompositeFuture>
mapper
- the mapper functionpublic <U> Future<U> compose(java.util.function.Function<CompositeFuture,Future<U>> successMapper, java.util.function.Function<Throwable,Future<U>> failureMapper)
successMapper
and failureMapper
functions.
When this future (the one on which compose
is called) succeeds, the successMapper
will be called with
the completed value and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
When this future (the one on which compose
is called) fails, the failureMapper
will be called with
the failure and this mapper returns another future object. This returned future completion will complete
the future returned by this method call.
If any mapper function throws an exception, the returned future will be failed with this exception.
compose
in class Future<CompositeFuture>
successMapper
- the function mapping the successfailureMapper
- the function mapping the failurepublic <U> Future<U> map(java.util.function.Function<CompositeFuture,U> mapper)
mapper
function on this future.
When this future succeeds, the mapper
will be called with the completed value and this mapper
returns a value. This value will complete the future returned by this method call.
If the mapper
throws an exception, the returned future will be failed with this exception.
When this future fails, the failure will be propagated to the returned future and the mapper
will not be called.
map
in class Future<CompositeFuture>
mapper
- the mapper function@Deprecated public Handler<AsyncResult<CompositeFuture>> completer()
completer
in class Future<CompositeFuture>
public Future<CompositeFuture> recover(java.util.function.Function<Throwable,Future<CompositeFuture>> mapper)
recover
in class Future<CompositeFuture>
mapper
- A function which takes the exception of a failure and returns a new future.public Future<CompositeFuture> otherwise(java.util.function.Function<Throwable,CompositeFuture> mapper)
mapper
function on this future.
When this future fails, the mapper
will be called with the completed value and this mapper
returns a value. This value will complete the future returned by this method call.
If the mapper
throws an exception, the returned future will be failed with this exception.
When this future succeeds, the result will be propagated to the returned future and the mapper
will not be called.
otherwise
in class Future<CompositeFuture>
mapper
- the mapper functionpublic Future<CompositeFuture> otherwise(CompositeFuture value)
value
.
When this future fails, this value
will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
otherwise
in class Future<CompositeFuture>
value
- the value that eventually completes the mapped futurepublic Future<CompositeFuture> otherwiseEmpty()
null
.
This is a convenience for future.otherwise((T) null)
.
When this future fails, the null
value will complete the future returned by this method call.
When this future succeeds, the result will be propagated to the returned future.
otherwiseEmpty
in class Future<CompositeFuture>
public static <T1,T2> CompositeFuture all(Future<T1> f1, Future<T2> f2)
f1
or f2
fails.f1
- futuref2
- futurepublic static <T1,T2,T3> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3)
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 3 futures.f1
- f2
- f3
- public static <T1,T2,T3,T4> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 4 futures.f1
- f2
- f3
- f4
- public static <T1,T2,T3,T4,T5> CompositeFuture all(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 5 futures.f1
- f2
- f3
- f4
- f5
- 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)
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 6 futures.f1
- f2
- f3
- f4
- f5
- f6
- public static CompositeFuture all(List<Future> futures)
all(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with a list of futures.When the list is empty, the returned future will be already completed.
futures
- public static <T1,T2> CompositeFuture any(Future<T1> f1, Future<T2> f2)
f1
or f2
succeeds.f1
- futuref2
- futurepublic static <T1,T2,T3> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3)
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 3 futures.f1
- f2
- f3
- public static <T1,T2,T3,T4> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 4 futures.f1
- f2
- f3
- f4
- public static <T1,T2,T3,T4,T5> CompositeFuture any(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 5 futures.f1
- f2
- f3
- f4
- f5
- 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)
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 6 futures.f1
- f2
- f3
- f4
- f5
- f6
- public static CompositeFuture any(List<Future> futures)
any(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with a list of futures.When the list is empty, the returned future will be already completed.
futures
- public static <T1,T2> CompositeFuture join(Future<T1> f1, Future<T2> f2)
f1
or f2
fails.f1
- futuref2
- futurepublic static <T1,T2,T3> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3)
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 3 futures.f1
- f2
- f3
- public static <T1,T2,T3,T4> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4)
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 4 futures.f1
- f2
- f3
- f4
- public static <T1,T2,T3,T4,T5> CompositeFuture join(Future<T1> f1, Future<T2> f2, Future<T3> f3, Future<T4> f4, Future<T5> f5)
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 5 futures.f1
- f2
- f3
- f4
- f5
- 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)
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with 6 futures.f1
- f2
- f3
- f4
- f5
- f6
- public static CompositeFuture join(List<Future> futures)
join(io.vertx.rxjava.core.Future<T1>, io.vertx.rxjava.core.Future<T2>)
but with a list of futures.When the list is empty, the returned future will be already completed.
futures
- @Deprecated public CompositeFuture setHandler(Handler<AsyncResult<CompositeFuture>> handler)
Future
setHandler
in class Future<CompositeFuture>
@Deprecated public Observable<CompositeFuture> setHandlerObservable()
Future
setHandlerObservable
in class Future<CompositeFuture>
@Deprecated public Single<CompositeFuture> rxSetHandler()
Future
rxSetHandler
in class Future<CompositeFuture>
public CompositeFuture onComplete(Handler<AsyncResult<CompositeFuture>> handler)
Future
onComplete
in class Future<CompositeFuture>
handler
- the handler that will be called with the result@Deprecated public Observable<CompositeFuture> onCompleteObservable()
Future
onCompleteObservable
in class Future<CompositeFuture>
public Single<CompositeFuture> rxOnComplete()
Future
rxOnComplete
in class Future<CompositeFuture>
public CompositeFuture onSuccess(Handler<CompositeFuture> handler)
Future
onSuccess
in class Future<CompositeFuture>
handler
- the handler that will be called with the succeeded resultpublic CompositeFuture onFailure(Handler<Throwable> handler)
Future
onFailure
in class Future<CompositeFuture>
handler
- the handler that will be called with the failed resultpublic void complete()
complete
in class Future<CompositeFuture>
public boolean tryComplete()
tryComplete
in class Future<CompositeFuture>
public Throwable cause(int index)
index
- the wrapped future indexpublic boolean succeeded(int index)
index
- the wrapped future indexpublic boolean failed(int index)
index
- the wrapped future indexpublic boolean isComplete(int index)
index
- the wrapped future indexpublic <T> T resultAt(int index)
index
- the wrapped future indexpublic int size()
public static CompositeFuture newInstance(CompositeFuture arg)
Copyright © 2023 Eclipse. All rights reserved.