Method: ThreadPool#each

Defined in:
lib/nswtopo/helpers/thread_pool.rb

#each(&block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/nswtopo/helpers/thread_pool.rb', line 22

def each(&block)
  queue = Queue.new
  threads(queue, &block).tap do
    @args.inject(queue, &:<<).close
  end.each(&:join)
  @args
end