tuweni / org.apache.tuweni.concurrent / AsyncResult / handle

handle

abstract fun <U : Any!> handle(fn: BiFunction<in T, Throwable!, out U>!): AsyncResult<U>! (source)

Returns a new result that, when this result completes either normally or exceptionally, completes with the value obtained from executing the supplied function with this result's value and exception as arguments.

Either the value or the exception supplied to the function will be null.

Parameters

fn - BiFunction<in T, Throwable!, out U>!: The function to execute.

- The type of the value returned from the function.

Return
AsyncResult<U>!: A new result.