Module: GitRunner::Threading
Instance Method Summary collapse
Instance Method Details
#join ⇒ Object
15 16 17 18 19 |
# File 'lib/git-runner/threading.rb', line 15 def join # TODO: Timeout with failure alerts thread_group.list.each(&:join) end |
#spawn ⇒ Object
6 7 8 9 |
# File 'lib/git-runner/threading.rb', line 6 def spawn raise ThreadError.new('must be called with a block') unless block_given? thread_group.add(Thread.new { yield }) end |
#thread_group ⇒ Object
11 12 13 |
# File 'lib/git-runner/threading.rb', line 11 def thread_group @thread_group ||= ThreadGroup.new end |