arrow-fx / arrow.fx / Ref / tryUpdate

tryUpdate

abstract fun tryUpdate(f: (A) -> A): Kind<F, Boolean>

Attempts to modify the current value once, in contrast to update which calls f until it succeeds.

Returns false if concurrent modification completes between the time the variable is read and the time it is set.

Do you like Arrow?

Arrow Org
<