ForkLocal

ox.ForkLocal
See theForkLocal companion object
class ForkLocal[T](default: T)

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def get(): T
def supervisedErrorWhere[E, F[_], U](errorMode: ErrorMode[E, F])(newValue: T)(f: (OxError[E, F]) ?=> F[U]): F[U]

Creates a new supervisedError scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Creates a new supervisedError scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Warning: due to the "structured" nature of setting a fork local's value, forks created using external (wider) scopes will not see the updated value, but the one associated with the original scope.

Attributes

def supervisedWhere[U](newValue: T)(f: Ox ?=> U): U

Creates a new supervised scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Creates a new supervised scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Warning: due to the "structured" nature of setting a fork local's value, forks created using external (wider) scopes will not see the updated value, but the one associated with the original scope.

Attributes

def unsupervisedWhere[U](newValue: T)(f: OxUnsupervised ?=> U): U

Creates a new unsupervised scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Creates a new unsupervised scope, where the value of this fork local is set to newValue, only for the duration of the scope.

Warning: due to the "structured" nature of setting a fork local's value, forks created using external (wider) scopes will not see the updated value, but the one associated with the original scope.

Warning: It is advisable to use supervised scopes if possible, as they minimize the chances of an error to go unnoticed. unsupervised scopes are considered an advanced feature, and should be used with caution.

Attributes