Sha256: 9d4bb2d95aa65a458961f1dd5c8650bff773d757e531bc2b27e27f3b1477c42e
Contents?: true
Size: 1.02 KB
Versions: 2
Compression:
Stored size: 1.02 KB
Contents
module DispatchRider class Runner include Callbacks::Support def self.run new.process end def initialize callbacks.invoke(:initialize) do ready set_queue_from_config end end private_class_method :new def process callbacks.invoke(:process) do logger.info "Running..." @subscriber.process end end private delegate :config, to: :DispatchRider delegate :logger, to: :config def ready logger.info "Creating subscriber..." @subscriber = config.subscriber.new config.handlers.each do |handler_name| logger.info "Registering #{handler_name} handler..." @subscriber.register_handler(handler_name) end end def set_queue_from_config kind = config.queue_kind info = config.queue_info logger.info "Setting #{kind} queue @ #{info.to_json} ..." @subscriber.register_queue(kind, info) @subscriber.setup_demultiplexer(kind, config.error_handler) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
dispatch-rider-2.1.0 | lib/dispatch-rider/runner.rb |
dispatch-rider-2.0.0 | lib/dispatch-rider/runner.rb |