Atomically sets the value to the given updated value only if the current value is equal to the expected value.
true if successful, or false if the actual value
was not equal to the expected value
the expected 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-stateserver-side setting.Methods that require serialization/deserialization may throw RangeError, e.g when there is no suitable serializer for a certain type.