module EventQ
Public Class Methods
create_event_type(event_type)
click to toggle source
# File lib/eventq/base.rb, line 10 def self.create_event_type(event_type) if EventQ.namespace == nil return event_type end return "#{EventQ.namespace}-#{event_type}" end
create_exchange_name(exchange)
click to toggle source
# File lib/eventq/rabbitmq.rb, line 13 def self.create_exchange_name(exchange) create_queue_name(exchange) end
create_queue_name(queue)
click to toggle source
# File lib/eventq/base.rb, line 17 def self.create_queue_name(queue) return queue.name if EventQ.namespace == nil delimiter = queue.namespace_delimiter || '-' return "#{EventQ.namespace}#{delimiter}#{queue.name}" end
log(type, message)
click to toggle source
# File lib/eventq/eventq_base/eventq_logger.rb, line 13 def self.log(type, message) case type when :info logger.info(message) when :debug logger.debug(message) when :error logger.error(message) end rescue #do nothing end
logger()
click to toggle source
# File lib/eventq/eventq_base/eventq_logger.rb, line 5 def self.logger return @@logger end
namespace()
click to toggle source
# File lib/eventq/base.rb, line 2 def self.namespace @namespace end
namespace=(value)
click to toggle source
# File lib/eventq/base.rb, line 6 def self.namespace=(value) @namespace = value end
set_logger(logger)
click to toggle source
# File lib/eventq/eventq_base/eventq_logger.rb, line 9 def self.set_logger(logger) @@logger = logger end