class Concurrent::Promises::ResolvableFuture

def reason(timeout = nil, timeout_value = nil, resolve_on_timeout = nil)

Other tags:
    See: Future#reason -

Returns:
  • (Exception, timeout_value, nil) -
def reason(timeout = nil, timeout_value = nil, resolve_on_timeout = nil)
  if wait_until_resolved timeout
    internal_state.reason
  else
    if resolve_on_timeout
      unless resolve(*resolve_on_timeout, false)
        # if it fails to resolve it was resolved in the meantime
        # so return value as if there was no timeout
        return internal_state.reason
      end
    end
    timeout_value
  end
end