//arrow-fx-coroutines/arrow.fx.coroutines/onCancel
common inline suspend fun <A> onCancel(fa: suspend () -> A, crossinline onCancel: suspend () -> Unit): A
Registers an onCancel handler after fa. onCancel is guaranteed to be called in case of cancellation, otherwise it’s ignored.
This function is useful for wiring cancellation tokens between fibers, building inter-op with other effect systems or testing.
common
guarantee | for registering a handler that is guaranteed to always run. |
guaranteeCase | for registering a handler that executes for any ExitCase. |
common
fa | program that you want to register handler on |
onCancel | handler to run when fa gets cancelled. |
Do you like Arrow?
✖