Clears the current stored reference, so it becomes a null
.
Atomically sets the value to the given updated value only if the current value is equal to the expected value.
the expected value
the new value
true
if successful, or false
if the actual value
was not equal to the expected value
Checks if the reference contains the value.
the value to check (is allowed to be null
)
true
if the value is found, false
otherwise
Destroys this object cluster-wide. Clears all resources taken for this object.
Gets the current value.
the current value
Gets the old value and sets the new value.
the new value
the old value
Returns the unique name of this object.
Returns the key of the partition that this DistributedObject is assigned to.
For a partitioned data structure, the returned value will not be null
,
but otherwise undefined
.
Returns the service name for this object.
Checks if the stored reference is null
.
true
if null
, false
otherwise
Atomically sets the given value.
the new value
Generated using TypeDoc
A distributed, highly available object reference with atomic operations.
IAtomicReference offers linearizability during crash failures and network partitions. It is CP with respect to the CAP principle. If a network partition occurs, it remains available on at most one side of the partition.
The following are some considerations you need to know when you use IAtomicReference:
IFunction
-based methods, likealter()
orapply()
are not yet supported by Hazelcast Node.js client.IAtomicReference does not offer exactly-once / effectively-once execution semantics. It goes with at-least-once execution semantics by default and can cause an API call to be committed multiple times in case of CP member failures. It can be tuned to offer at-most-once execution semantics. Please see
fail-on-indeterminate-operation-state
server-side setting.Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.