Class: GitMiner::Dispatch::ParallelDispatch
- Inherits:
-
AbstractDispatch
- Object
- AbstractDispatch
- GitMiner::Dispatch::ParallelDispatch
- Defined in:
- lib/git_miner/dispatch/parallel_dispatch.rb
Defined Under Namespace
Classes: ShaFound
Constant Summary collapse
- IDENTIFIER =
"Parallel"
Constants inherited from AbstractDispatch
Instance Method Summary collapse
Methods inherited from AbstractDispatch
Constructor Details
This class inherits a constructor from GitMiner::Dispatch::AbstractDispatch
Instance Method Details
#parallel_groups ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/git_miner/dispatch/parallel_dispatch.rb', line 35 def parallel_groups -> do = @group_manager. committer_offset = @group_manager.committer_offset @group_manager.advance! [ , committer_offset ] end end |
#perform ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/git_miner/dispatch/parallel_dispatch.rb', line 17 def perform Parallel.each(parallel_groups, in_processes: Concurrent.processor_count, preserve_results: false) do |group| , committer_offset = group result = @engine.mine( author_offset: , committer_offset: committer_offset, qty: @group_manager.batch_size ) if result raise(ShaFound, result) end end rescue ShaFound => e e.result end |