class Concurrent::IVar

def initialize(value = NO_VALUE, opts = {})

Options Hash: (**opts)
  • :copy_on_deref (String) -- call the given `Proc` passing the internal value and
  • :freeze_on_deref (String) -- call `#freeze` before returning the data
  • :dup_on_deref (String) -- call `#dup` before returning the data

Parameters:
  • opts (Hash) -- the options to create a message with
  • value (Object) -- the initial value
def initialize(value = NO_VALUE, opts = {})
  init_obligation
  self.observers = CopyOnWriteObserverSet.new
  set_deref_options(opts)
  if value == NO_VALUE
    @state = :pending
  else
    set(value)
  end
end