Class: Legion::Transport::Consumer
- Inherits:
-
Consumer
- Object
- Consumer
- Legion::Transport::Consumer
- Includes:
- Common
- Defined in:
- lib/legion/transport/consumer.rb
Constant Summary
Constants included from Common
Legion::Transport::Common::NAMESPACE_BOUNDARIES
Instance Attribute Summary collapse
-
#consumer_tag ⇒ Object
readonly
Returns the value of attribute consumer_tag.
Instance Method Summary collapse
-
#initialize(queue:, no_ack: false, exclusive: false, consumer_tag: generate_consumer_tag, **opts) ⇒ Consumer
constructor
A new instance of Consumer.
Methods included from Common
#channel, #channel_open?, #close, #close!, #deep_merge, #generate_consumer_tag, #open_channel, #options_builder
Constructor Details
#initialize(queue:, no_ack: false, exclusive: false, consumer_tag: generate_consumer_tag, **opts) ⇒ Consumer
Returns a new instance of Consumer.
12 13 14 15 16 17 |
# File 'lib/legion/transport/consumer.rb', line 12 def initialize(queue:, no_ack: false, exclusive: false, consumer_tag: generate_consumer_tag, **opts) @consumer_tag = consumer_tag super(channel, queue, consumer_tag, no_ack, exclusive, opts) queue_name = queue.respond_to?(:name) ? queue.name : queue.to_s log.info "Consumer subscribed to #{queue_name} with tag #{consumer_tag}" end |
Instance Attribute Details
#consumer_tag ⇒ Object (readonly)
Returns the value of attribute consumer_tag.
10 11 12 |
# File 'lib/legion/transport/consumer.rb', line 10 def consumer_tag @consumer_tag end |