Method: Thread::Pool#timeout_for
- Defined in:
- lib/thread/pool.rb
#timeout_for(task, timeout) ⇒ Object
Define a timeout for a task.
295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/thread/pool.rb', line 295 def timeout_for (task, timeout) unless @timeout spawn_timeout_thread end @mutex.synchronize { @timeouts[task] = timeout wake_up_timeout } end |