Method: ThreadStorm#execute
- Defined in:
- lib/thread_storm.rb
#execute(*args, &block) ⇒ Object
Creates an execution and schedules it to be run by the thread pool. Return value is a ThreadStorm::Execution.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/thread_storm.rb', line 44 def execute(*args, &block) Execution.new(args, default_value, &block).tap do |execution| @sentinel.synchronize do |e_cond, p_cond| e_cond.wait_while{ all_workers_busy? } if execute_blocks? @queue << execution @executions << execution p_cond.signal end end end |