arrow-fx / arrow.fx.extensions.io.bracket / arrow.Kind / onCancel

onCancel

@JvmName("onCancel") fun <A> Kind<ForIO, A>.~~onCancel~~(finalizer: Kind<ForIO, Unit>): IO<A> Deprecated: The IO datatype and it’s related type classes will disappear in Arrow 0.13.0. All useful operations are offered directly over suspend functions by Arrow Fx Coroutines. https://arrow-kt.io/docs/fx/async/

Executes the given finalizer when the source is cancelled, allowing registering a cancellation token.

Useful for wiring cancellation tokens between fibers, building inter-op with other effect systems or testing.

Do you like Arrow?

Arrow Org
<