Sha256: 99003d7e8ddfb19bc2c2d6840317bf6de45e75dcd78e145df2f11e42f990fa56

Contents?: true

Size: 1.42 KB

Versions: 32

Compression:

Stored size: 1.42 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

      class WorkerBegin < Hydra::Message
        def handle(master, worker)
          master.worker_begin(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

32 entries across 32 versions & 8 rubygems

Version Path
ngauthier-hydra-0.24.0 lib/hydra/message/worker_messages.rb
nulogy-hydra-0.26.0 lib/hydra/message/worker_messages.rb
arturop-hydra-0.25.0 lib/hydra/message/worker_messages.rb
arturop-hydra-0.24.0 lib/hydra/message/worker_messages.rb
hydra-0.24.0 lib/hydra/message/worker_messages.rb
nulogy-hydra-0.23.2.1 lib/hydra/message/worker_messages.rb
justinf-hydra-0.23.8 lib/hydra/message/worker_messages.rb
justinf-hydra-0.23.7 lib/hydra/message/worker_messages.rb
justinf-hydra-0.23.6 lib/hydra/message/worker_messages.rb
justinf-hydra-0.23.5 lib/hydra/message/worker_messages.rb
justinf-hydra-0.23.4 lib/hydra/message/worker_messages.rb
arturop-hydra-0.23.4 lib/hydra/message/worker_messages.rb
sskirby-hydra-0.23.3 lib/hydra/message/worker_messages.rb
hydra-0.23.3 lib/hydra/message/worker_messages.rb
causes-hydra-0.21.0 lib/hydra/message/worker_messages.rb
hydra-0.23.2 lib/hydra/message/worker_messages.rb
hydra-0.23.1 lib/hydra/message/worker_messages.rb
hydra-0.23.0 lib/hydra/message/worker_messages.rb
hydra-0.22.2 lib/hydra/message/worker_messages.rb
hydra-0.22.1 lib/hydra/message/worker_messages.rb