Class: Apollo::Agent::DomainerAgent
- Defined in:
- lib/apollo_crawler/agent/domainer_agent.rb
Instance Attribute Summary collapse
-
#declarations ⇒ Object
Returns the value of attribute declarations.
Instance Method Summary collapse
-
#initialize(amqp, opts = {}) ⇒ DomainerAgent
constructor
A new instance of DomainerAgent.
Methods inherited from BaseAgent
Constructor Details
#initialize(amqp, opts = {}) ⇒ DomainerAgent
Returns a new instance of DomainerAgent.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# 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, , payload| puts "DomainerAgent: Received, metadata #{.inspect}" if opts[:verbose] msg = JSON.parse(payload) end end |
Instance Attribute Details
#declarations ⇒ Object
Returns the value of attribute declarations.
31 32 33 |
# File 'lib/apollo_crawler/agent/domainer_agent.rb', line 31 def declarations @declarations end |