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
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/mutant/parallel/worker.rb', line 90 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.
80 81 82 |
# File 'lib/mutant/parallel/worker.rb', line 80 def index config.index end |
#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.
124 125 126 127 |
# File 'lib/mutant/parallel/worker.rb', line 124 def join process.wait(pid) self end |
#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
119 120 121 122 |
# File 'lib/mutant/parallel/worker.rb', line 119 def signal process.kill('TERM', pid) self end |