Sha256: c78094bd0c64bd14ff05e49a92b3059c9220c3e379de92c11457d891c532fba1

Contents?: true

Size: 1.28 KB

Versions: 29

Compression:

Stored size: 1.28 KB

Contents

module Hydra #:nodoc: 
  module Messages #:nodoc:
    module Worker #:nodoc:
      # Message indicating that a worker needs a file to delegate to a runner
      class RequestFile < Hydra::Message
        def handle(master, worker) #:nodoc:
          master.send_file(worker)
        end
      end

      # Message telling the Runner to run a file
      class RunFile < Hydra::Message
        # The file that should be run
        attr_accessor :file
        def serialize #:nodoc:
          super(:file => @file)
        end
        def handle(runner) #:nodoc:
          runner.run_file(@file)
        end
      end

      # Message to tell the Runner to shut down
      class Shutdown < Hydra::Message
        def handle(runner) #:nodoc:
          runner.stop
        end
      end

      # Message relaying the results of a worker up to the master
      class Results < Hydra::Messages::Runner::Results
        def handle(master, worker) #:nodoc:
          master.process_results(worker, self)
        end
      end

      # Message a worker sends to a master to verify the connection
      class Ping < Hydra::Message
        def handle(master, worker) #:nodoc:
          # We don't do anything to handle a ping. It's just to test
          # the connectivity of the IO
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
hydra-0.11.0 lib/hydra/message/worker_messages.rb
hydra-0.10.3 lib/hydra/message/worker_messages.rb
hydra-0.10.2 lib/hydra/message/worker_messages.rb
hydra-0.10.1 lib/hydra/message/worker_messages.rb
hydra-0.10.0 lib/hydra/message/worker_messages.rb
hydra-0.9.0 lib/hydra/message/worker_messages.rb
hydra-0.8.0 lib/hydra/message/worker_messages.rb
hydra-0.7.2 lib/hydra/message/worker_messages.rb
hydra-0.7.0 lib/hydra/message/worker_messages.rb