Method: Concurrent#try_exchange
- Defined in:
- lib/concurrent-ruby/concurrent/exchanger.rb
#try_exchange(value, timeout = nil) ⇒ Concurrent::Maybe
Waits for another thread to arrive at this exchange point (unless the current thread is interrupted), and then transfers the given object to it, receiving its object in return. The timeout value indicates the approximate number of seconds the method should block while waiting for the exchange. When the timeout value is nil the method will block indefinitely.
The return value will be a Maybe set to Just on success or Nothing on timeout.
|
|
# File 'lib/concurrent-ruby/concurrent/exchanger.rb', line 349
|