arrow-effects-reactor-extensions / arrow.effects.reactor.extensions.fluxk.bracket / arrow.Kind

Extensions for arrow.Kind

bracket fun <A, B> Kind<ForFluxK, A>.bracket(arg1: (A) -> Kind<ForFluxK, Unit>, arg2: (A) -> Kind<ForFluxK, B>): FluxK<B>
Meant for specifying tasks with safe resource acquisition and release in the face of errors and interruption. It would be the the equivalent of try/catch/finally statements in mainstream imperative languages for resource acquisition and release.
bracketCase fun <A, B> Kind<ForFluxK, A>.bracketCase(arg1: (A, ExitCase<Throwable>) -> Kind<ForFluxK, Unit>, arg2: (A) -> Kind<ForFluxK, B>): FluxK<B>
A way to safely acquire a resource and release in the face of errors and cancellation. It uses ExitCase to distinguish between different exit cases when releasing the acquired resource.
guarantee fun <A> Kind<ForFluxK, A>.guarantee(arg1: Kind<ForFluxK, Unit>): FluxK<A>
Executes the given finalizer when the source is finished, either in success or in error, or if canceled.
guaranteeCase fun <A> Kind<ForFluxK, A>.guaranteeCase(arg1: (ExitCase<Throwable>) -> Kind<ForFluxK, Unit>): FluxK<A>
Executes the given finalizer when the source is finished, either in success or in error, or if canceled, allowing for differentiating between exit conditions. That’s thanks to the ExitCase argument of the finalizer.
uncancelable fun <A> Kind<ForFluxK, A>.uncancelable(): FluxK<A>
Meant for ensuring a given task continues execution even when interrupted.