class Concurrent::AtomicReference
@raise [Concurrent::ConcurrentUpdateError] if the update fails
@return [Object] the new value
info: github.com/ruby-concurrency/concurrent-ruby/pull/336<br>avoid raising exceptions (which are inherently slow) by default. For more
`AtomicReference#try_update` API. The reason this was changed was to
@note This behavior mimics the behavior of the original
@yieldparam [Object] old_value the starting value of the atomic reference
given (old) value
@yield [Object] Calculate a new value for the atomic reference using
fails.
with the block’s result. Raise an exception if the update
Pass the current value to the given block, replacing it
@!method try_update!
@return [Object] the new value, or nil if update failed
please see: github.com/ruby-concurrency/concurrent-ruby/pull/336<br>Instead, this method now returns ‘nil` in case of failure. For more info,
@note This method was altered to avoid raising an exception by default.
@yieldparam [Object] old_value the starting value of the atomic reference
given (old) value
@yield [Object] Calculate a new value for the atomic reference using
with the block’s result. Return nil if the update fails.
Pass the current value to the given block, replacing it
@!method try_update
@return [Object] the new value
@yieldparam [Object] old_value the starting value of the atomic reference
given (old) value
@yield [Object] Calculate a new value for the atomic reference using
during the block’s execution.
with the block’s result. May retry if the value changes
Pass the current value to the given block, replacing it
@!method update
that the actual value was not equal to the expected value.
@return [Boolean] ‘true` if successful. A `false` return indicates
@param [Object] new_value the new value
@param [Object] old_value the expected value
the current value == the expected value.
Atomically sets the value to the given updated value if
@!macro atomic_reference_method_compare_and_set
@!method compare_and_set(old_value, new_value)
@return [Object] the old value
@param [Object] new_value the new value
Atomically sets to the given value and returns the old value.
@!macro atomic_reference_method_get_and_set
@!method get_and_set(new_value)
@return [Object] the new value
@param [Object] new_value the new value
Sets to the given value.
@!macro atomic_reference_method_set
@!method set(new_value)
@return [Object] the current value
Gets the current value.
@!macro atomic_reference_method_get
@!method get
@param [Object] value The initial value.
@!macro atomic_reference_method_initialize
@!method initialize(value = nil)
@see docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html<br>@see docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/AtomicReference.html<br><br>@!macro thread_safe_variable_comparison
operations have java volatile semantic.
An object reference that may be updated atomically. All read and write
def to_s
-
(String)
- Short string representation.
def to_s format '%s value:%s>', super[0..-2], get end