Method: Concurrent::IVar#fail

Defined in:
lib/concurrent-ruby/concurrent/ivar.rb

#fail(reason = StandardError.new) ⇒ IVar

Set the ‘IVar` to failed due to some error and wake or notify all threads waiting on it.

Parameters:

  • reason (Object) (defaults to: StandardError.new)

    for the failure

Returns:

Raises:



135
136
137
# File 'lib/concurrent-ruby/concurrent/ivar.rb', line 135

def fail(reason = StandardError.new)
  complete(false, nil, reason)
end