ForkLocal

ox.ForkLocal
See theForkLocal companion object
class ForkLocal[T](scopedValue: ScopedValue[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 using external (wider) scopes should not be created, as an attempt to do so will throw a java.util.concurrent.StructureViolationException.

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 using external (wider) scopes should not be created, as an attempt to do so will throw a java.util.concurrent.StructureViolationException.

Attributes

def unsupervisedWhere[U](newValue: T)(f: OxPlain ?=> 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 using external (wider) scopes should not be created, as an attempt to do so will throw a java.util.concurrent.StructureViolationException.

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

Attributes