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:



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

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)


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

def self.has_content?
  false
end