Class: AMQ::Protocol::Queue::Declare

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, passive, durable, exclusive, auto_delete, nowait, arguments) ⇒ Object

“ticket = 0”, “queue = EMPTY_STRING”, “passive = false”, “durable = false”, “exclusive = false”, “auto_delete = false”, “nowait = false”, “arguments = {}”

Returns:



1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
# File 'lib/amq/protocol/client.rb', line 1007

def self.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
  ticket = 0
  buffer = ""
  buffer << @packed_indexes
  buffer << [ticket].pack(PACK_UINT16)
  buffer << queue.bytesize.chr
  buffer << queue
  bit_buffer = 0
  bit_buffer = bit_buffer | (1 << 0) if passive
  bit_buffer = bit_buffer | (1 << 1) if durable
  bit_buffer = bit_buffer | (1 << 2) if exclusive
  bit_buffer = bit_buffer | (1 << 3) if auto_delete
  bit_buffer = bit_buffer | (1 << 4) if nowait
  buffer << [bit_buffer].pack(PACK_CHAR)
  buffer << AMQ::Protocol::Table.encode(arguments)
  MethodFrame.new(buffer, channel)
end

.has_content?Boolean

Returns:

  • (Boolean)


1001
1002
1003
# File 'lib/amq/protocol/client.rb', line 1001

def self.has_content?
  false
end