Class Hydra::Worker
In: lib/hydra/worker.rb
Parent: Object

Hydra class responsible to dispatching runners and communicating with the master.

The Worker is never run directly by a user. Workers are created by a Master to delegate to Runners.

The general convention is to have one Worker per machine on a distributed network.

Methods

Included Modules

Hydra::Messages::Worker

Attributes

runners  [R] 

Public Class methods

Create a new worker.

  • io: The IO object to use to communicate with the master
  • num_runners: The number of runners to launch

Public Instance methods

When the master sends a file down to the worker, it hits this method. Then the worker delegates the file down to a runner.

When a runner finishes, it sends the results up to the worker. Then the worker sends the results up to the master.

When a runner wants a file, it hits this method with a message. Then the worker bubbles the file request up to the master.

When a master issues a shutdown order, it hits this method, which causes the worker to send shutdown messages to its runners.

[Validate]