Sha256: f868041e87450cceb0e62d1fbd1caa55d4c34b6d56a673aac7c581becad4fa62

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

module Wukong

  # A module which can be included by other drivers which lets them
  # use EventMachine under the hood.
  module EventMachineDriver
    
    include DriverMethods

    # :nodoc:
    def self.included klass
      klass.class_eval do
        def self.add_signal_traps
          Signal.trap('INT')  { log.info 'Received SIGINT. Stopping.'  ; EM.stop }
          Signal.trap('TERM') { log.info 'Received SIGTERM. Stopping.' ; EM.stop }                  
        end
      end
    end

    # :nodoc:
    def initialize(label, settings)
      super
      @settings = settings      
      @dataflow = construct_dataflow(label, settings)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wukong-3.0.1 lib/wukong/local/event_machine_driver.rb
wukong-3.0.0 lib/wukong/local/event_machine_driver.rb