Updates the internal reference of this assignable cancelable to the given value.
Updates the internal reference of this assignable cancelable to the given value.
If this cancelable is already canceled, then value
is
going to be canceled on assignment as well.
this
Cancels the unit of work represented by this reference.
Cancels the unit of work represented by this reference.
Guaranteed idempotency - calling it multiple times should have the same side-effect as calling it only once. Implementations of this method should also be thread-safe.
Clears the underlying reference, setting it to a Cancelable.empty (if not cancelled).
Clears the underlying reference, setting it to a Cancelable.empty (if not cancelled).
This is equivalent with:
ref := Cancelable.empty
The purpose of this method is to release any underlying reference for GC purposes, however if the underlying reference is a dummy then the assignment doesn't happen because we don't care about releasing dummy references.
true in case this cancelable hasn't been canceled, or false otherwise.
Represents a Cancelable whose underlying cancelable reference can be swapped for another.
Example:
Also see:
MultiAssignCancelable
, but with the capability of forcing ordering on concurrent updates