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.19.0 lib/hydra/message/worker_messages.rb
hydra-0.18.0 lib/hydra/message/worker_messages.rb
sskirby-hydra-0.17.1 lib/hydra/message/worker_messages.rb
sskirby-hydra-0.16.10 lib/hydra/message/worker_messages.rb
hydra-0.17.0 lib/hydra/message/worker_messages.rb
sskirby-hydra-0.16.9 lib/hydra/message/worker_messages.rb
hydra-0.16.7 lib/hydra/message/worker_messages.rb
hydra-0.16.6 lib/hydra/message/worker_messages.rb
hydra-0.16.5 lib/hydra/message/worker_messages.rb
hydra-0.16.4 lib/hydra/message/worker_messages.rb
hydra-0.16.3 lib/hydra/message/worker_messages.rb
hydra-0.16.2 lib/hydra/message/worker_messages.rb
hydra-0.16.1 lib/hydra/message/worker_messages.rb
hydra-0.16.0 lib/hydra/message/worker_messages.rb
hydra-0.15.1 lib/hydra/message/worker_messages.rb
hydra-0.15.0 lib/hydra/message/worker_messages.rb
hydra-0.14.1 lib/hydra/message/worker_messages.rb
hydra-0.14.0 lib/hydra/message/worker_messages.rb
hydra-0.13.0 lib/hydra/message/worker_messages.rb
hydra-0.12.0 lib/hydra/message/worker_messages.rb