setSuccessAndFailure

fun A_Fiber.setSuccessAndFailure(onSuccess: (AvailObject) -> Unit, onFailure: (Throwable) -> Unit)

Set the success and failure actions of this fiber. The former runs if the fiber succeeds, passing the resulting AvailObject, and also stashing it in the fiber. The latter runs if the fiber fails, passing the Throwable that caused the failure.

Parameters

onSuccess

The action to invoke with the fiber's result value.

onFailure

The action to invoke with the responsible throwable.