vertx / io.vertx.rxjava.core / CompositeFuture / compose

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

### Parameters

`handler` - the handler

`next` - the next future

Return
the next future, used for chaining

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

### Parameters

`mapper` - the mapper function

Return
the composed future