Method: Concurrent::Promises::Future#reason
- Defined in:
- lib/concurrent-ruby/concurrent/promises.rb
#reason(timeout = nil, timeout_value = nil) ⇒ Object, timeout_value
Note:
This function potentially blocks current thread until the Future is resolved. Be careful it can deadlock. Try to chain instead.
Note:
Make sure returned ‘nil` is not confused with timeout, no value when rejected, no reason when fulfilled, etc. Use more exact methods if needed, like AbstractEventFuture#wait, #value!, #result, etc.
Returns reason of future’s rejection. Calls AbstractEventFuture#touch.
955 956 957 958 959 960 961 |
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 955 def reason(timeout = nil, timeout_value = nil) if wait_until_resolved timeout internal_state.reason else timeout_value end end |