Obtains a snapshot of the current value of the Ref
, and a setter
for updating the value.
Obtains a snapshot of the current value of the Ref
, and a setter
for updating the value. The setter may noop (in which case false
is returned) if another concurrent call to access
uses its
setter first. Once it has noop'd or been used once, a setter
never succeeds again.
Like get
, but returns an F[Unit]
that can be used cancel the subscription.
*Asynchronously* sets a reference.
*Asynchronously* sets a reference. After the returned F[Unit]
is bound,
the task is running in the background. Multiple tasks may be added to a
Ref[A]
.
Satisfies: r.set(t) flatMap { _ => r.get } == t
.
Obtains the value of the Ref
, or wait until it has been set
.
Repeatedly invokes tryModify(f)
until it succeeds.
Like modify, but allows to extra b
in single step.
Like modify, but allows to extra b
in single step. *
*Asynchronously* sets a reference to a pure value.
*Asynchronously* sets a reference to a pure value.
Satisfies: r.setPure(a) flatMap { _ => r.get(a) } == pure(a)
.
Tries modifying the reference once, returning None
if another
concurrent set
or modify
completes between the time
the variable is read and the time it is set.
Like tryModify
but allows to return B
along with change.
Like tryModify
but allows to return B
along with change. *
An asynchronous, concurrent mutable reference.