Class: AMQ::Protocol::Basic::Consume

Inherits:
Method
  • Object
show all
Defined in:
lib/amq/protocol/client.rb

Class Method Summary collapse

Methods inherited from Method

encode_body, index, inherited, instantiate, method_id, methods, name, split_headers

Class Method Details

.encode(channel, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments) ⇒ Object

u’ticket = 0’, u’queue = EMPTY_STRING’, u’consumer_tag = EMPTY_STRING’, u’no_local = false’, u’no_ack = false’, u’exclusive = false’, u’nowait = false’, u’arguments = {}‘

Returns:



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
# File 'lib/amq/protocol/client.rb', line 1643

def self.encode(channel, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments)
  ticket = 0
  buffer = ''
  buffer << @packed_indexes
  buffer << [ticket].pack(PACK_UINT16)
  buffer << queue.to_s.bytesize.chr
  buffer << queue.to_s
  buffer << consumer_tag.to_s.bytesize.chr
  buffer << consumer_tag.to_s
  bit_buffer = 0
  bit_buffer = bit_buffer | (1 << 0) if no_local
  bit_buffer = bit_buffer | (1 << 1) if no_ack
  bit_buffer = bit_buffer | (1 << 2) if exclusive
  bit_buffer = bit_buffer | (1 << 3) if nowait
  buffer << [bit_buffer].pack(PACK_CHAR)
  buffer << AMQ::Protocol::Table.encode(arguments)
  MethodFrame.new(buffer, channel)
end

.has_content?Boolean

Returns:

  • (Boolean)


1637
1638
1639
# File 'lib/amq/protocol/client.rb', line 1637

def self.has_content?
  false
end