Class: GorgonAMQ::Protocol::Basic::Consume

Inherits:
Method
  • Object
show all
Defined in:
lib/gorgon_amq-protocol/lib/gorgon_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:



1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 1590

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 << GorgonAMQ::Protocol::Table.encode(arguments)
  MethodFrame.new(buffer, channel)
end

.has_content?Boolean

Returns:

  • (Boolean)


1584
1585
1586
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 1584

def self.has_content?
  false
end