lib/garcon/task/delay.rb
# Return the value this object represents after applying the options
# specified by the `#set_deref_options` method. If the delayed operation
# raised an exception this method will return nil. The execption object
# can be accessed via the `#reason` method.
#
# @param [Numeric]
#   Timeout the maximum number of seconds to wait.
#
# @return [Object] the current value of the object.
#
Return the value this object represents after applying the options
specified by the `#set_deref_options` method. If the delayed operation
raised an exception this method will return nil. The execption object
can be accessed via the `#reason` method.
Return the value this object represents after applying the options specified by the ` #set_deref_options ` method . If the delayed operation raised an exception this method will return nil . The execption object can be accessed via the ` #reason ` method .
def value(timeout = nil)
      if @task_executor
        super
      else
        mutex.synchronize do
          execute = @computing = true unless @computing
          if execute
            begin
              set_state(true, @task.call, nil)
            rescue => e
              set_state(false, nil, e)
            end
          end
        end
        if @do_nothing_on_deref
          @value
        else
          apply_deref_options(@value)
        end
      end
    end
def value ( timeout = nil ) if @task_executor super else mutex . synchronize do execute = @computing = true unless @computing if execute begin set_state ( true , @task . call , nil ) rescue => e set_state ( false , nil , e ) end end end if @do_nothing_on_deref @value else apply_deref_options ( @value ) end end end
Return the value this object represents after applying the options
specified by the `#set_deref_options` method.
Return the value this object represents after applying the options specified by the ` #set_deref_options ` method .
the current value of the object.
the current value of the object .
Object
timeout
<not_specific>
<not_specific>
Timeout the maximum number of seconds to wait.
Timeout the maximum number of seconds to wait .