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

“ticket = 0”, “queue = EMPTY_STRING”, “consumer_tag = EMPTY_STRING”, “no_local = false”, “no_ack = false”, “exclusive = false”, “nowait = false”, “arguments = {}”

Returns:



1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
# File 'lib/amq/protocol/client.rb', line 1548

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.bytesize.chr
  buffer << queue
  buffer << consumer_tag.bytesize.chr
  buffer << consumer_tag
  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)


1542
1543
1544
# File 'lib/amq/protocol/client.rb', line 1542

def self.has_content?
  false
end