Class: Mutant::Parallel::Worker Private

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/mutant/parallel/worker.rb

Overview

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.

Parallel execution worker

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(attributes) ⇒ 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

Parameters:

  • Hash<Symbol, (Hash<Symbol, Object] attributes)

    Object] attributes

Returns:

  • (self)


16
17
18
19
# File 'lib/mutant/parallel/worker.rb', line 16

def self.run(attributes)
  new(attributes).run
  self
end

Instance Method Details

#runself

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.

Worker loop

rubocop:disable Lint/Loop

Returns:

  • (self)


28
29
30
31
32
# File 'lib/mutant/parallel/worker.rb', line 28

def run
  begin
    parent.call(Actor::Message.new(:ready, mailbox.sender))
  end until handle(mailbox.receiver.call)
end