Sha256: ef82a44aa7915fd0fb3cdb65e059cd0f04aacb246928776b80dacf98c6619beb

Contents?: true

Size: 976 Bytes

Versions: 9

Compression:

Stored size: 976 Bytes

Contents

module Hyperstack
  # Tricky business here. Hyperstack::Store will define boot
  # if it is not already defined.  It creates a minimal compatible
  # API that includes the run and on_dispatch methods.  This way
  # you can use the Boot interface without loading operations.

  # Here we define Boot, but in case it has already been defined
  # we make sure to run the inherited method, and define the
  # on_dispatch and run methods.   Finally we copy any receivers
  # that may have been defined on the existing Boot to the new class.
  class Application
    Operation.inherited(Boot) if defined? Boot
    class Boot < Operation
      #broadcaster.receiver(self, *args, &block)
      def self.on_dispatch(&block)
        _Railway.add_receiver(&block)
      end
      def self.run(*args)
        ClientDrivers.initialize_client_drivers_on_boot
        _run(*args)
      end
    end
    Boot.receivers.each { |r| Boot.on_dispatch(&r) } if Boot.respond_to? :receivers
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyper-operation-1.0.alpha1.8 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.7 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.6 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.5 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.4 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.3 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.2 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1.1 lib/hyper-operation/boot.rb
hyper-operation-1.0.alpha1 lib/hyper-operation/boot.rb