Method: Circuitry::Processors::Threader.process

Defined in:
lib/circuitry/processors/threader.rb

.process(&block) ⇒ Object

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
# File 'lib/circuitry/processors/threader.rb', line 9

def process(&block)
  raise ArgumentError, 'no block given' unless block_given?

  pool << Thread.new do
    safely_process(&block)
    on_exit.call if on_exit
  end
end