Class: Monkey::Runner::ThreadPool

Inherits:
Monkey::Runner show all
Defined in:
lib/monkeyjob/runner/thread_pool.rb

Instance Method Summary collapse

Constructor Details

#initializeThreadPool



6
7
8
# File 'lib/monkeyjob/runner/thread_pool.rb', line 6

def initialize
  @pool = ::ThreadPool.new
end

Instance Method Details

#closeObject



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