Class: AMQP::Client::Consumer

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp/client/consumer.rb

Overview

Consumer abstraction

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#basic_consume_argsObject (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

#blockObject (readonly)

Returns the value of attribute block.



7
8
9
# File 'lib/amqp/client/consumer.rb', line 7

def block
  @block
end

#channel_idObject (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

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/amqp/client/consumer.rb', line 7

def id
  @id
end

#prefetchObject (readonly)

Returns the value of attribute prefetch.



7
8
9
# File 'lib/amqp/client/consumer.rb', line 7

def prefetch
  @prefetch
end

#queueObject (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

#cancelself

Cancel the consumer

Returns:

  • (self)


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

Returns:

  • (Boolean)


30
31
32
# File 'lib/amqp/client/consumer.rb', line 30

def closed?
  @consume_ok.msg_q.closed?
end

#tagString

Return the consumer tag

Returns:

  • (String)


36
37
38
# File 'lib/amqp/client/consumer.rb', line 36

def tag
  @consume_ok.consumer_tag
end