Class: Mutant::Parallel::Worker Private
- Inherits:
-
Object
- Object
- Mutant::Parallel::Worker
- Includes:
- Unparser::Adamantium
- Defined in:
- lib/mutant/parallel/worker.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: Config
Class Method Summary collapse
- .start(**attributes) ⇒ Object private
Instance Method Summary collapse
-
#call ⇒ self
private
Run worker loop.
- #index ⇒ Object private
- #join ⇒ Object private
-
#signal ⇒ Object
private
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength.
Class Method Details
.start(**attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/mutant/parallel/worker.rb', line 24 def self.start(**attributes) start_config(Config.new(**attributes)) end |
Instance Method Details
#call ⇒ self
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run worker loop
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/mutant/parallel/worker.rb', line 92 def call loop do job = next_job or break job_start(job) connection.send_value(job.payload) response = Connection::Reader.read_response( deadline: config.world.deadline(config.timeout), io: config.world.io, job:, log_reader:, marshal: config.world.marshal, response_reader: ) job_done(job) break if add_response(response) || response.error end finalize self end |
#index ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
84 |
# File 'lib/mutant/parallel/worker.rb', line 84 def index = config.index |
#join ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
123 |
# File 'lib/mutant/parallel/worker.rb', line 123 def join = tap { process.wait(pid) } |
#signal ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Metrics/AbcSize rubocop:enable Metrics/MethodLength
121 |
# File 'lib/mutant/parallel/worker.rb', line 121 def signal = tap { process.kill('TERM', pid) } |