Class: Lapine::Consumer::Topology
- Inherits:
-
Struct
- Object
- Struct
- Lapine::Consumer::Topology
- Defined in:
- lib/lapine/consumer/topology.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config
5 6 7 |
# File 'lib/lapine/consumer/topology.rb', line 5 def config @config end |
#logger ⇒ Object
Returns the value of attribute logger
5 6 7 |
# File 'lib/lapine/consumer/topology.rb', line 5 def logger @logger end |
Instance Method Details
#close! ⇒ Object
27 28 29 30 31 32 |
# File 'lib/lapine/consumer/topology.rb', line 27 def close! return unless @cons @cons.values.each do |conn| conn.close! end end |
#each_binding ⇒ Object
7 8 9 10 11 12 |
# File 'lib/lapine/consumer/topology.rb', line 7 def each_binding config.queues.each do |node| classes = classify(node['handlers']) yield node['q'], get_conn(node['topic']), node['routing_key'], classes end end |
#each_queue_to_delete ⇒ Object
14 15 16 17 18 19 |
# File 'lib/lapine/consumer/topology.rb', line 14 def each_queue_to_delete config.delete_queues.each do |node| classes = classify(node['handlers']) yield node['q'], get_conn(node['topic']), node['routing_key'], classes end end |
#each_topic ⇒ Object
21 22 23 24 25 |
# File 'lib/lapine/consumer/topology.rb', line 21 def each_topic config.topics.each do |topic| yield topic end end |