Obtain a snapshot of the current value of the Ref
, and a setter
for updating the value.
Like get
, but returns a Task[Unit]
that can be used cancel the subscription.
Return the most recently completed set
, or block until a set
value is available.
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. *
Return a Task
that submits t
to this ref for evaluation.
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)
.
Runs t1
and t2
simultaneously, but only the winner gets to
set
to this ref
.
Runs t1
and t2
simultaneously, but only the winner gets to
set
to this ref
. The loser continues running but its reference
to this ref is severed, allowing this ref to be garbage collected
if it is no longer referenced by anyone other than the loser.
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.
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. *