Class: Monkey::Runner::ThreadPool
- Inherits:
-
Monkey::Runner
- Object
- Monkey::Runner
- Monkey::Runner::ThreadPool
- Defined in:
- lib/monkeyjob/runner/thread_pool.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ ThreadPool
constructor
A new instance of ThreadPool.
- #run(job) ⇒ Object
Constructor Details
#initialize ⇒ ThreadPool
6 7 8 |
# File 'lib/monkeyjob/runner/thread_pool.rb', line 6 def initialize @pool = ::ThreadPool.new end |
Instance Method Details
#close ⇒ Object
10 11 12 |
# File 'lib/monkeyjob/runner/thread_pool.rb', line 10 def close @pool.close end |
#run(job) ⇒ Object
14 15 16 |
# File 'lib/monkeyjob/runner/thread_pool.rb', line 14 def run(job) @pool.try_run(&job) end |