Class: Recognizer::Input::AMQP

Inherits:
Base
  • Object
show all
Defined in:
lib/recognizer/inputs/amqp.rb

Instance Method Summary collapse

Methods inherited from Base

descendants, #enabled?

Constructor Details

#initialize(options = {}) ⇒ AMQP

Returns a new instance of AMQP.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/recognizer/inputs/amqp.rb', line 6

def initialize(options={})
  super

  @enabled = @options.has_key?(:amqp)

  @options[:amqp]                          ||= Hash.new
  @options[:amqp][:exchange]               ||= Hash.new
  @options[:amqp][:exchange][:name]        ||= "graphite"
  @options[:amqp][:exchange][:durable]     ||= false
  @options[:amqp][:exchange][:routing_key] ||= "#"
  @options[:amqp][:exchange][:type]        ||= (@options[:amqp][:exchange][:type] || "topic").to_sym
end

Instance Method Details

#runObject



19
20
21
# File 'lib/recognizer/inputs/amqp.rb', line 19

def run
  setup_consumer
end