A simplified version of addFinalizerWith
when the finalizer
does not
depend on the Exit
value that the scope is closed with.
Extends the scope of a ZIO
workflow that needs a scope into this scope by
providing it to the workflow but not closing the scope when the workflow
completes execution.
Extends the scope of a ZIO
workflow that needs a scope into this scope by
providing it to the workflow but not closing the scope when the workflow
completes execution. This allows extending a scoped value into a larger
scope.
A
Scope
is the foundation of safe, composable resource management in ZIO. A scope has two fundamental operators,addFinalizer
, which adds a finalizer to the scope, andclose
, which closes a scope and runs all finalizers that have been added to the scope.