Class: AMQP::Client::Consumer
- Inherits:
-
Object
- Object
- AMQP::Client::Consumer
- Defined in:
- lib/amqp/client/consumer.rb
Overview
Consumer abstraction
Instance Attribute Summary collapse
-
#basic_consume_args ⇒ Object
readonly
Returns the value of attribute basic_consume_args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#prefetch ⇒ Object
readonly
Returns the value of attribute prefetch.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#cancel ⇒ self
Cancel the consumer.
-
#closed? ⇒ Boolean
True if the consumer is cancelled/closed.
-
#tag ⇒ String
Return the consumer tag.
Instance Attribute Details
#basic_consume_args ⇒ Object (readonly)
Returns the value of attribute basic_consume_args.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def basic_consume_args @basic_consume_args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def block @block end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def channel_id @channel_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def id @id end |
#prefetch ⇒ Object (readonly)
Returns the value of attribute prefetch.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def prefetch @prefetch end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
7 8 9 |
# File 'lib/amqp/client/consumer.rb', line 7 def queue @queue end |
Instance Method Details
#cancel ⇒ self
Cancel the consumer
23 24 25 26 |
# File 'lib/amqp/client/consumer.rb', line 23 def cancel @client.cancel_consumer(self) self end |
#closed? ⇒ Boolean
True if the consumer is cancelled/closed
30 31 32 |
# File 'lib/amqp/client/consumer.rb', line 30 def closed? @consume_ok.msg_q.closed? end |
#tag ⇒ String
Return the consumer tag
36 37 38 |
# File 'lib/amqp/client/consumer.rb', line 36 def tag @consume_ok.consumer_tag end |