Class: GorgonAMQ::Protocol::Exchange::Declare

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

u’ticket = 0’, u’exchange = nil’, u“type = u’direct’”, u’passive = false’, u’durable = false’, u’auto_delete = false’, u’internal = false’, u’nowait = false’, u’arguments = {}‘

Returns:



806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 806

def self.encode(channel, exchange, type, passive, durable, auto_delete, internal, nowait, arguments)
  ticket = 0
  buffer = @packed_indexes.dup
  buffer << [ticket].pack(PACK_UINT16)
  buffer << exchange.to_s.bytesize.chr
  buffer << exchange.to_s
  buffer << type.to_s.bytesize.chr
  buffer << type.to_s
  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 auto_delete
  bit_buffer = bit_buffer | (1 << 3) if internal
  bit_buffer = bit_buffer | (1 << 4) if nowait
  buffer << [bit_buffer].pack(PACK_CHAR)
  buffer << GorgonAMQ::Protocol::Table.encode(arguments)
  MethodFrame.new(buffer, channel)
end

.has_content?Boolean

Returns:

  • (Boolean)


800
801
802
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 800

def self.has_content?
  false
end