Obtain a snapshot of the current value of the Ref
, and a setter
for updating the value.
Obtain 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 set a reference.
Asynchronously set 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
.
Obtain the value of the Ref
, or wait until it has been set
.
Repeatedly invoke 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 set a reference to a pure value.
Asynchronously set a reference to a pure value.
Satisfies: r.setPure(a) flatMap { _ => r.get(a) } == pure(a)
.
Try 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.