class Apollo::Agent::DomainerAgent

Attributes

declarations[RW]

Public Class Methods

new(amqp, opts={}) click to toggle source
# File lib/apollo_crawler/agent/domainer_agent.rb, line 33
def initialize(amqp, opts={})
        if(opts[:verbose])
                puts "Initializing crawler agent..."
        end

        # Declarations
        channel = amqp.create_channel
        declarations = Apollo::Agent.declare_entities(channel, opts)

        # Binding
        declarations[:queues]["domainer.queue"].bind(declarations[:exchanges]["domainer"]).subscribe do |delivery_info, metadata, payload|
                puts "DomainerAgent: Received, metadata #{metadata.inspect}" if opts[:verbose]

                msg = JSON.parse(payload)
        end
end