Class: Henitai::ParallelExecutionRunner
- Inherits:
-
Object
- Object
- Henitai::ParallelExecutionRunner
- Defined in:
- lib/henitai/parallel_execution_runner.rb
Overview
Runs pending mutants across worker threads with signal and stdin handling.
Defined Under Namespace
Classes: ParallelExecutionContext
Instance Method Summary collapse
- #execute_parallel_execution(context, stdin_pipe:, process_mutant:) ⇒ Object
-
#initialize(worker_count:) ⇒ ParallelExecutionRunner
constructor
A new instance of ParallelExecutionRunner.
- #run(mutants, integration, config, progress_reporter, options = {}) ⇒ Object
Constructor Details
#initialize(worker_count:) ⇒ ParallelExecutionRunner
Returns a new instance of ParallelExecutionRunner.
11 12 13 |
# File 'lib/henitai/parallel_execution_runner.rb', line 11 def initialize(worker_count:) @worker_count = worker_count end |
Instance Method Details
#execute_parallel_execution(context, stdin_pipe:, process_mutant:) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/henitai/parallel_execution_runner.rb', line 29 def execute_parallel_execution(context, stdin_pipe:, process_mutant:) install_parallel_signal_traps(context) start_parallel_stdin_watcher(context, stdin_pipe) parallel_workers(context, process_mutant).each(&:join) ensure stop_parallel_stdin_watcher(context) restore_parallel_signal_traps(context) raise context.state[:error] if context&.state&.fetch(:error, nil) raise Interrupt if context&.state&.fetch(:stopping, false) end |
#run(mutants, integration, config, progress_reporter, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/henitai/parallel_execution_runner.rb', line 15 def run(mutants, integration, config, progress_reporter, = {}) context = build_parallel_context( mutants, integration, config, progress_reporter ) execute_parallel_execution( context, stdin_pipe: .fetch(:stdin_pipe, false), process_mutant: .fetch(:process_mutant) ) end |