CallbackFailure

A mechanism for indicating when a Java lambda has completed unsuccessfully. By having a Callback invoke this when it's deemed to have failed instead of coupling it to the time that the lambda function invocation returns or throws, the Java client is free to pass the responsibility for completing the callback to other Java Threads, such as thread pools, completion mechanisms, coroutines, etc. Each CallbackCompletion must be invoked at most once, and mutually exclusively of the associated CallbackFailure.

It's safe to invoke neither the completion nor failure handler for a callback, and the corresponding fiber will eventually be subject to garbage collection.

Invoking both the completion and failure, or either of them more than once, currently causes all but the first invocation to be ignored.

Functions

Link copied to clipboard
abstract fun failed(throwable: Throwable)

Invoke this callback failure handler.