TrackingFiberRef

class TrackingFiberRef[A](fiberRef: FiberRef[A], link: A => Unit) extends Proxy[A]
class Proxy[A]
trait FiberRef[A]
class Object
trait Matchable
class Any

Type members

Inherited types

override type Patch = Patch
Inherited from:
Proxy
type Value = A

The type of the value of the FiberRef.

The type of the value of the FiberRef.

Inherited from:
FiberRef

Value members

Concrete methods

override def locally[R, EC, C](value: A)(use: ZIO[R, EC, C])(implicit trace: Trace): ZIO[R, EC, C]
Definition Classes
override def modify[B](f: A => (B, A))(implicit trace: Trace): UIO[B]
Definition Classes

Inherited methods

def asThreadLocal(implicit trace: Trace, unsafe: Unsafe): UIO[ThreadLocal[A]]

Returns a ThreadLocal that can be used to interact with this FiberRef from side effecting code.

Returns a ThreadLocal that can be used to interact with this FiberRef from side effecting code.

This feature is meant to be used for integration with side effecting code, that needs to access fiber specific data, like MDC contexts and the like. The returned ThreadLocal will be backed by this FiberRef on all threads that are currently managed by ZIO when this feature is enabled using Runtime.enableCurrentFiber, and behave like an ordinary ThreadLocal on all other threads.

Inherited from:
FiberRef
override def combine(first: Patch, second: Patch): Patch
Definition Classes
Inherited from:
Proxy
def delete(implicit trace: Trace): UIO[Unit]
Inherited from:
FiberRef
override def diff(oldValue: Value, newValue: Value): Patch
Definition Classes
Inherited from:
Proxy
override def fork: Patch
Definition Classes
Inherited from:
Proxy
def get(implicit trace: Trace): UIO[A]

Reads the value associated with the current fiber. Returns initial value if no value was set or inherited from parent.

Reads the value associated with the current fiber. Returns initial value if no value was set or inherited from parent.

Inherited from:
FiberRef
final def getAndSet(newValue: A)(implicit trace: Trace): UIO[A]

Atomically sets the value associated with the current fiber and returns the old value.

Atomically sets the value associated with the current fiber and returns the old value.

Inherited from:
FiberRef
final def getAndUpdate(f: A => A)(implicit trace: Trace): UIO[A]

Atomically modifies the FiberRef with the specified function and returns the old value.

Atomically modifies the FiberRef with the specified function and returns the old value.

Inherited from:
FiberRef
final def getAndUpdateSome(pf: PartialFunction[A, A])(implicit trace: Trace): UIO[A]

Atomically modifies the FiberRef with the specified partial function and returns the old value. If the function is undefined on the current value it doesn't change it.

Atomically modifies the FiberRef with the specified partial function and returns the old value. If the function is undefined on the current value it doesn't change it.

Inherited from:
FiberRef
def getWith[R, E, B](f: A => ZIO[R, E, B])(implicit trace: Trace): ZIO[R, E, B]

Gets the value associated with the current fiber and uses it to run the specified effect.

Gets the value associated with the current fiber and uses it to run the specified effect.

Inherited from:
FiberRef
override def initial: A
Definition Classes
Inherited from:
Proxy
override def join(oldValue: Value, newValue: Value): Value
Definition Classes
Inherited from:
Proxy
final def locallyScoped(value: A)(implicit trace: Trace): ZIO[Scope, Nothing, Unit]

Returns a scoped workflow that sets the value associated with the curent fiber to the specified value and restores it to its original value when the scope is closed.

Returns a scoped workflow that sets the value associated with the curent fiber to the specified value and restores it to its original value when the scope is closed.

Inherited from:
FiberRef
final def locallyScopedWith(f: A => A)(implicit trace: Trace): ZIO[Scope, Nothing, Unit]

Returns a scoped workflow that updates the value associated with the current fiber using the specified function and restores it to its original value when the scope is closed.

Returns a scoped workflow that updates the value associated with the current fiber using the specified function and restores it to its original value when the scope is closed.

Inherited from:
FiberRef
final def locallyWith[R, E, B](f: A => A)(zio: ZIO[R, E, B])(implicit trace: Trace): ZIO[R, E, B]

Returns a ZIO that runs with f applied to the current fiber.

Returns a ZIO that runs with f applied to the current fiber.

Guarantees that fiber data is properly restored via acquireRelease.

Inherited from:
FiberRef
final def modifySome[B](default: B)(pf: PartialFunction[A, (B, A)])(implicit trace: Trace): UIO[B]

Atomically modifies the FiberRef with the specified partial function, which computes a return value for the modification if the function is defined in the current value otherwise it returns a default value. This is a more powerful version of updateSome.

Atomically modifies the FiberRef with the specified partial function, which computes a return value for the modification if the function is defined in the current value otherwise it returns a default value. This is a more powerful version of updateSome.

Inherited from:
FiberRef
override def patch(patch: Patch)(oldValue: Value): Value
Definition Classes
Inherited from:
Proxy
final def reset(implicit trace: Trace): UIO[Unit]
Inherited from:
FiberRef
def set(value: A)(implicit trace: Trace): UIO[Unit]

Sets the value associated with the current fiber.

Sets the value associated with the current fiber.

Inherited from:
FiberRef
def update(f: A => A)(implicit trace: Trace): UIO[Unit]

Atomically modifies the FiberRef with the specified function.

Atomically modifies the FiberRef with the specified function.

Inherited from:
FiberRef
final def updateAndGet(f: A => A)(implicit trace: Trace): UIO[A]

Atomically modifies the FiberRef with the specified function and returns the result.

Atomically modifies the FiberRef with the specified function and returns the result.

Inherited from:
FiberRef
final def updateSome(pf: PartialFunction[A, A])(implicit trace: Trace): UIO[Unit]

Atomically modifies the FiberRef with the specified partial function. If the function is undefined on the current value it doesn't change it.

Atomically modifies the FiberRef with the specified partial function. If the function is undefined on the current value it doesn't change it.

Inherited from:
FiberRef
final def updateSomeAndGet(pf: PartialFunction[A, A])(implicit trace: Trace): UIO[A]

Atomically modifies the FiberRef with the specified partial function. If the function is undefined on the current value it returns the old value without changing it.

Atomically modifies the FiberRef with the specified partial function. If the function is undefined on the current value it returns the old value without changing it.

Inherited from:
FiberRef

Inherited fields

Inherited from:
Proxy