Sha256: f1ae73a5780cb7074fb0c12bbd1cb538e6c718ae57c8661c2373c77cea4450f6
Contents?: true
Size: 1.02 KB
Versions: 13
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
13 entries across 13 versions & 1 rubygems