Method: Async::Scheduler#timeout_after
- Defined in:
- lib/async/scheduler.rb
#timeout_after(duration, exception, message, &block) ⇒ Object
Invoke the block, but after the specified timeout, raise the specified exception with the given message. If the block runs to completion before the timeout occurs or there are no non-blocking operations after the timeout expires, the code will complete without any exception.
643 644 645 646 647 |
# File 'lib/async/scheduler.rb', line 643 def timeout_after(duration, exception, , &block) with_timeout(duration, exception, ) do yield duration end end |