open fun <U : Any> compose(handler: Handler<T>, 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.
Return
the next future, used for chaining
open fun <U : Any> compose(mapper: Function<T, 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.
Return
the composed future