Module: Ragnar

Defined in:
lib/ragnar/connector.rb,
lib/ragnar.rb,
lib/ragnar/version.rb,
lib/ragnar/exchange.rb,
lib/ragnar/simple_queue.rb

Overview

Provide a simple connector piece that runs EM and passes through AMQP connection options

Defined Under Namespace

Classes: Config, Connector, Exchange, SimpleQueue

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.exchange(type, name, options = {}) {|x| ... } ⇒ Object

Yields:

  • (x)


10
11
12
13
14
# File 'lib/ragnar.rb', line 10

def exchange type, name, options={}
  x = Ragnar::Exchange.new(type, name, options)
  yield(x) if block_given?
  x
end

.log_message(level, message, params = {}) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/ragnar.rb', line 67

def self.log_message(level, message, params={})
  ::Ragnar::Config.logger.send(level, message)
rescue => e
  $stdout << <<-LOG
    No Logger found in ::Ragnar::log_message

    Attempted to Log:
      message : #{message}
      params : #{params}
  LOG
  $stdout << $/
end