class TrackingFiberRef[A] extends Proxy[A]
- Alphabetic
- By Inheritance
- TrackingFiberRef
- Proxy
- FiberRef
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type Patch = FiberRef.Patch
The type of the patch that describes updates to the value of the
FiberRef
.The type of the patch that describes updates to the value of the
FiberRef
. In the simple case this will just be a function that sets the value of theFiberRef
. In more complex cases this will describe an update to a piece of a whole value, allowing updates to the value by different fibers to be combined in a compositional way when those fibers are joined. - type Value = A
The type of the value of the
FiberRef
.The type of the value of the
FiberRef
.- Definition Classes
- FiberRef
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asThreadLocal(implicit trace: Trace, unsafe: Unsafe): UIO[ThreadLocal[A]]
Returns a
ThreadLocal
that can be used to interact with thisFiberRef
from side effecting code.Returns a
ThreadLocal
that can be used to interact with thisFiberRef
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 thisFiberRef
on all threads that are currently managed by ZIO when this feature is enabled using Runtime.enableCurrentFiber, and behave like an ordinaryThreadLocal
on all other threads.- Definition Classes
- FiberRef
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def combine(first: Patch, second: Patch): Patch
Combines two patches to produce a new patch that describes the updates of the first patch and then the updates of the second patch.
Combines two patches to produce a new patch that describes the updates of the first patch and then the updates of the second patch. The combine operation should be associative. In addition, if the combine operation is commutative then joining multiple fibers concurrently will result in deterministic
FiberRef
values. - val delegate: FiberRef[A]
- Definition Classes
- Proxy
- def delete(implicit trace: Trace): UIO[Unit]
- Definition Classes
- FiberRef
- def diff(oldValue: Value, newValue: Value): Patch
Constructs a patch describing the updates to a value from an old value and a new value.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fork: Patch
The initial patch that is applied to the value of the
FiberRef
when a new fiber is forked. - def get(implicit trace: Trace): UIO[A]
Reads the value associated with the current fiber.
Reads the value associated with the current fiber. Returns initial value if no value was
set
or inherited from parent.- Definition Classes
- 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.
- Definition Classes
- 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.- Definition Classes
- 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.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.- Definition Classes
- FiberRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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.
- Definition Classes
- FiberRef
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initial: A
The initial value of the
FiberRef
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def join(oldValue: Value, newValue: Value): Value
- def locally[R, EC, C](value: A)(use: ZIO[R, EC, C])(implicit trace: Trace): ZIO[R, EC, C]
Returns a
ZIO
that runs withvalue
bound to the current fiber.Returns a
ZIO
that runs withvalue
bound to the current fiber.Guarantees that fiber data is properly restored via
acquireRelease
.- Definition Classes
- TrackingFiberRef → FiberRef
- 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.
- Definition Classes
- 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.
- Definition Classes
- 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 withf
applied to the current fiber.Returns a
ZIO
that runs withf
applied to the current fiber.Guarantees that fiber data is properly restored via
acquireRelease
.- Definition Classes
- FiberRef
- def modify[B](f: (A) => (B, A))(implicit trace: Trace): UIO[B]
Atomically modifies the
FiberRef
with the specified function, which computes a return value for the modification.Atomically modifies the
FiberRef
with the specified function, which computes a return value for the modification. This is a more powerful version ofupdate
.- Definition Classes
- TrackingFiberRef → 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.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 ofupdateSome
.- Definition Classes
- FiberRef
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def patch(patch: Patch)(oldValue: Value): Value
Applies a patch to an old value to produce a new value that is equal to the old value with the updates described by the patch.
- final def reset(implicit trace: Trace): UIO[Unit]
- Definition Classes
- 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.
- Definition Classes
- FiberRef
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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.- Definition Classes
- 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.- Definition Classes
- FiberRef
- final def updateSome(pf: PartialFunction[A, A])(implicit trace: Trace): UIO[Unit]
Atomically modifies the
FiberRef
with the specified partial function.Atomically modifies the
FiberRef
with the specified partial function. If the function is undefined on the current value it doesn't change it.- Definition Classes
- FiberRef
- final def updateSomeAndGet(pf: PartialFunction[A, A])(implicit trace: Trace): UIO[A]
Atomically modifies the
FiberRef
with the specified partial function.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.- Definition Classes
- FiberRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()