Companion object for Scope, providing the global scope, child scope implementation, and the OpenScope handle.
Attributes
- Companion
- class
- Source
- Scope.scala
- Graph
-
- Supertypes
- Self type
-
Scope.type
Members list
Type members
Classlikes
A child scope created by scoped { ... } or Scope.open.
A child scope created by scoped { ... } or Scope.open.
Child scopes have their own finalizer registry and are linked to a parent scope. When the child closes, its finalizers run in LIFO order. The $[A] type is structurally distinct from the parent's, preventing accidental value mixing at compile time (use Scope.lower to convert explicitly).
Type parameters
- P
-
the concrete type of the parent scope
Value parameters
- finalizers
-
the finalizer registry for this child
- owner
-
opaque reference to the creating thread (used by isOwner)
- parent
-
the parent scope that created this child
- unowned
-
if
true, isOwner always returnstrue(used by Scope.open)
Attributes
- Source
- Scope.scala
- Supertypes
- Self type
-
Child[P]
A handle returned by Scope.open representing an explicitly-managed child scope.
A handle returned by Scope.open representing an explicitly-managed child scope.
Value parameters
- close
-
a function that detaches the child from its parent, runs the child's finalizers in LIFO order, and returns a Finalization collecting any errors
- scope
-
the child scope that was created
Attributes
- Source
- Scope.scala
- Supertypes
The root of all scope hierarchies.
The root of all scope hierarchies.
global is self-referential (parent == this) and never closes under normal operation. Its $[A] is simply A (zero-cost identity). Finalizers registered with global.defer run on JVM shutdown via a shutdown hook. isOwner always returns true.
Attributes
- Source
- Scope.scala
- Supertypes
- Self type
-
global.type