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:



1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
# File 'lib/amq/protocol/client.rb', line 1664

def self.encode(channel, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments)
  ticket = 0
  buffer = @packed_indexes.dup
  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)


1658
1659
1660
# File 'lib/amq/protocol/client.rb', line 1658

def self.has_content?
  false
end