Scope

object Scope
Companion:
class
class Object
trait Matchable
class Any
Scope.type

Type members

Classlikes

sealed trait Closeable extends Scope
final class ExtendPartiallyApplied[R](scope: Scope) extends AnyVal
final class UsePartiallyApplied[R](scope: Closeable) extends AnyVal

Value members

Concrete methods

def addFinalizer(finalizer: => UIO[Any])(implicit trace: Trace): ZIO[Scope, Nothing, Unit]

Accesses a scope in the environment and adds a finalizer to it.

Accesses a scope in the environment and adds a finalizer to it.

def addFinalizerExit(finalizer: Exit[Any, Any] => UIO[Any])(implicit trace: Trace): ZIO[Scope, Nothing, Unit]

Accesses a scope in the environment and adds a finalizer to it.

Accesses a scope in the environment and adds a finalizer to it.

def make(implicit trace: Trace): UIO[Closeable]

Makes a scope. Finalizers added to this scope will be run sequentially in the reverse of the order in which they were added when this scope is closed.

Makes a scope. Finalizers added to this scope will be run sequentially in the reverse of the order in which they were added when this scope is closed.

def makeWith(executionStrategy: => ExecutionStrategy)(implicit trace: Trace): UIO[Closeable]

Makes a scope. Finalizers added to this scope will be run according to the specified ExecutionStrategy.

Makes a scope. Finalizers added to this scope will be run according to the specified ExecutionStrategy.

def parallel(implicit trace: Trace): UIO[Closeable]

Makes a scope. Finalizers added to this scope will be run in parallel when this scope is closed.

Makes a scope. Finalizers added to this scope will be run in parallel when this scope is closed.

Concrete fields

val default: ZLayer[Any, Nothing, Scope]

A layer that constructs a scope and closes it when the workflow the layer is provided to completes execution, whether by success, failure, or interruption. This can be used to close a scope when providing a layer to a workflow.

A layer that constructs a scope and closes it when the workflow the layer is provided to completes execution, whether by success, failure, or interruption. This can be used to close a scope when providing a layer to a workflow.

The global scope which is never closed. Finalizers added to this scope will be immediately discarded and closing this scope has no effect.

The global scope which is never closed. Finalizers added to this scope will be immediately discarded and closing this scope has no effect.