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 payload.
- #index ⇒ Object private
- #join ⇒ Object private
- #signal ⇒ Object private
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.
23 24 25 |
# File 'lib/mutant/parallel/worker.rb', line 23 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 payload
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mutant/parallel/worker.rb', line 73 def call loop do job = next_job or break job_start(job) result = connection.call(job.payload) job_done(job) break if add_result(result) 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.
66 67 68 |
# File 'lib/mutant/parallel/worker.rb', line 66 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.
96 97 98 99 |
# File 'lib/mutant/parallel/worker.rb', line 96 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.
91 92 93 94 |
# File 'lib/mutant/parallel/worker.rb', line 91 def signal process.kill('TERM', pid) self end |