Class: AMQ::Protocol::Basic::Deliver
- Defined in:
- lib/amq/protocol/client.rb
Instance Attribute Summary collapse
-
#consumer_tag ⇒ Object
readonly
Returns the value of attribute consumer_tag.
-
#delivery_tag ⇒ Object
readonly
Returns the value of attribute delivery_tag.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#redelivered ⇒ Object
readonly
Returns the value of attribute redelivered.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
Class Method Summary collapse
-
.decode(data) ⇒ Object
Optimized decode using getbyte and unpack1 for better performance.
- .has_content? ⇒ Boolean
Instance Method Summary collapse
-
#initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) ⇒ Deliver
constructor
A new instance of Deliver.
Methods inherited from Method
encode_body, index, inherited, instantiate, method_id, methods, name, split_headers
Constructor Details
#initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) ⇒ Deliver
Returns a new instance of Deliver.
1891 1892 1893 1894 1895 1896 1897 |
# File 'lib/amq/protocol/client.rb', line 1891 def initialize(consumer_tag, delivery_tag, redelivered, exchange, routing_key) @consumer_tag = consumer_tag @delivery_tag = delivery_tag @redelivered = redelivered @exchange = exchange @routing_key = routing_key end |
Instance Attribute Details
#consumer_tag ⇒ Object (readonly)
Returns the value of attribute consumer_tag.
1890 1891 1892 |
# File 'lib/amq/protocol/client.rb', line 1890 def consumer_tag @consumer_tag end |
#delivery_tag ⇒ Object (readonly)
Returns the value of attribute delivery_tag.
1890 1891 1892 |
# File 'lib/amq/protocol/client.rb', line 1890 def delivery_tag @delivery_tag end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
1890 1891 1892 |
# File 'lib/amq/protocol/client.rb', line 1890 def exchange @exchange end |
#redelivered ⇒ Object (readonly)
Returns the value of attribute redelivered.
1890 1891 1892 |
# File 'lib/amq/protocol/client.rb', line 1890 def redelivered @redelivered end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
1890 1891 1892 |
# File 'lib/amq/protocol/client.rb', line 1890 def routing_key @routing_key end |
Class Method Details
.decode(data) ⇒ Object
Optimized decode using getbyte and unpack1 for better performance
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 |
# File 'lib/amq/protocol/client.rb', line 1870 def self.decode(data) offset = 0 length = data.getbyte(offset) offset += 1 consumer_tag = data.byteslice(offset, length) offset += length delivery_tag = data.byteslice(offset, 8).unpack1(PACK_UINT64_BE) offset += 8 redelivered = (data.getbyte(offset) & 1) != 0 offset += 1 length = data.getbyte(offset) offset += 1 exchange = data.byteslice(offset, length) offset += length length = data.getbyte(offset) offset += 1 routing_key = data.byteslice(offset, length) self.new(consumer_tag, delivery_tag, redelivered, exchange, routing_key) end |
.has_content? ⇒ Boolean
1899 1900 1901 |
# File 'lib/amq/protocol/client.rb', line 1899 def self.has_content? true end |