vertx / io.vertx.reactivex.core / CompositeFuture

CompositeFuture

open class CompositeFuture : Future<CompositeFuture>

The composite future wraps a list of io.vertx.reactivex.core.Future, 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 io.vertx.core.CompositeFuture non RX-ified interface using Vert.x codegen.

Constructors

<init>

CompositeFuture(delegate: CompositeFuture)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<CompositeFuture>

Inherited Properties

__typeArg_0

val __typeArg_0: TypeArg<T>

Functions

all

open static fun <T1 : Any, T2 : Any> all(f1: Future<T1>, f2: Future<T2>): CompositeFuture

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.

open static fun <T1 : Any, T2 : Any, T3 : Any> all(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#all but with 3 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any> all(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#all but with 4 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any> all(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>, f5: Future<T5>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#all but with 5 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any, T6 : Any> all(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>, f5: Future<T5>, f6: Future<T6>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#all but with 6 futures.

open static fun all(futures: MutableList<Future<Any>>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#all but with a list of futures.

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

any

open static fun <T1 : Any, T2 : Any> any(f1: Future<T1>, f2: Future<T2>): CompositeFuture

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.

open static fun <T1 : Any, T2 : Any, T3 : Any> any(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#any but with 3 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any> any(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#any but with 4 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any> any(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>, f5: Future<T5>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#any but with 5 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any, T6 : Any> any(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>, f5: Future<T5>, f6: Future<T6>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#any but with 6 futures.

open static fun any(futures: MutableList<Future<Any>>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#any but with a list of futures.

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

cause

open fun cause(index: Int): Throwable

Returns a cause of a wrapped future

complete

open fun complete(result: CompositeFuture): Unit

Set the result. Any handler will be called, if there is one, and the future will be marked as completed.

open fun complete(): Unit

Set this instance as result. Any handler will be called, if there is one, and the future will be marked as completed.

completer

open fun completer(): Handler<AsyncResult<CompositeFuture>>

compose

open fun <U : Any> compose(handler: Handler<CompositeFuture>, next: Future<U>): Future<U>

Compose this future with a provided next future.

When this (the one on which compose is called) future succeeds, the handler will be called with the completed value, this handler should complete the next future.

If the handler throws an exception, the returned future will be failed with this exception.

When this future fails, the failure will be propagated to the next future and the handler will not be called.

open fun <U : Any> compose(mapper: Function<CompositeFuture, Future<U>>): Future<U>

Compose this future with a 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.

equals

open fun equals(other: Any?): Boolean

failed

open fun failed(index: Int): Boolean

Returns true if a wrapped future is failed

getDelegate

open fun getDelegate(): CompositeFuture

hashCode

open fun hashCode(): Int

isComplete

open fun isComplete(index: Int): Boolean

Returns true if a wrapped future is completed

join

open static fun <T1 : Any, T2 : Any> join(f1: Future<T1>, f2: Future<T2>): CompositeFuture

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.

open static fun <T1 : Any, T2 : Any, T3 : Any> join(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#join but with 3 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any> join(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#join but with 4 futures.

open static fun <T1 : Any, T2 : Any, T3 : Any, T4 : Any, T5 : Any> join(f1: Future<T1>, f2: Future<T2>, f3: Future<T3>, f4: Future<T4>, f5: Future<T5>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#join but with 5 futures.

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

Like io.vertx.reactivex.core.CompositeFuture#join but with 6 futures.

open static fun join(futures: MutableList<Future<Any>>): CompositeFuture

Like io.vertx.reactivex.core.CompositeFuture#join but with a list of futures.

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

map

open fun <U : Any> map(mapper: Function<CompositeFuture, U>): Future<U>

Apply a 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.

newInstance

open static fun newInstance(arg: CompositeFuture): CompositeFuture

otherwise

open fun otherwise(mapper: Function<Throwable, CompositeFuture>): Future<CompositeFuture>

Apply a 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.

open fun otherwise(value: CompositeFuture): Future<CompositeFuture>

Map the failure of a future to a specific 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.

otherwiseEmpty

open fun otherwiseEmpty(): Future<CompositeFuture>

Map the failure of a future to 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.

recover

open fun recover(mapper: Function<Throwable, Future<CompositeFuture>>): Future<CompositeFuture>

Handles a failure of this Future by returning the result of another Future. If the mapper fails, then the returned future will be failed with this failure.

result

open fun result(): CompositeFuture

The result of the operation. This will be null if the operation failed.

resultAt

open fun <T : Any> resultAt(index: Int): T

Returns the result of a wrapped future

rxSetHandler

open fun rxSetHandler(): Single<CompositeFuture>

setHandler

open fun setHandler(handler: Handler<AsyncResult<CompositeFuture>>): CompositeFuture

size

open fun size(): Int

succeeded

open fun succeeded(index: Int): Boolean

Returns true if a wrapped future is succeeded

toString

open fun toString(): String

tryComplete

open fun tryComplete(result: CompositeFuture): Boolean

Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.

open fun tryComplete(): Boolean

Try to set this instance as result. When it happens, any handler will be called, if there is one, and the future will be marked as completed.

Inherited Functions

cause

open fun cause(): Throwable

A Throwable describing failure. This will be null if the operation succeeded.

fail

open fun fail(cause: Throwable): Unit

Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.

open fun fail(failureMessage: String): Unit

Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed.

failed

open fun failed(): Boolean

Did it fail?

failedFuture

open static fun <T : Any> failedFuture(t: Throwable): Future<T>

Create a failed future with the specified failure cause.

open static fun <T : Any> failedFuture(failureMessage: String): Future<T>

Create a failed future with the specified failure message.

future

open static fun <T : Any> future(handler: Handler<Future<T>>): Future<T>

Create a future that hasn't completed yet and that is passed to the handler before it is returned.

open static fun <T : Any> future(): Future<T>

Create a future that hasn't completed yet

isComplete

open fun isComplete(): Boolean

Has the future completed?

It's completed if it's either succeeded or failed.

map

open fun <V : Any> map(value: V): Future<V>

Map the result of a future to a specific value.

When this future succeeds, this value will complete the future returned by this method call.

When this future fails, the failure will be propagated to the returned future.

mapEmpty

open fun <V : Any> mapEmpty(): Future<V>

Map the result of a future to null.

This is a conveniency for future.map((T) null) or future.map((Void) null).

When this future succeeds, null will complete the future returned by this method call.

When this future fails, the failure will be propagated to the returned future.

newInstance

open static fun <T : Any> newInstance(arg: Future<Any>): Future<T>
open static fun <T : Any> newInstance(arg: Future<Any>, __typeArg_T: TypeArg<T>): Future<T>

succeeded

open fun succeeded(): Boolean

Did it succeed?

succeededFuture

open static fun <T : Any> succeededFuture(): Future<T>

Create a succeeded future with a null result

open static fun <T : Any> succeededFuture(result: T): Future<T>

Created a succeeded future with the specified result.

tryFail

open fun tryFail(failureMessage: String): Boolean
open fun tryFail(cause: Throwable): Boolean

Try to set the failure. When it happens, any handler will be called, if there is one, and the future will be marked as completed.