Class: Mqlight::Delivery
- Inherits:
-
Object
- Object
- Mqlight::Delivery
- Includes:
- Logging
- Defined in:
- lib/mqlight/delivery.rb
Overview
This class represents an attempt to deliver message data to the client.
Instance Attribute Summary collapse
-
#confirm ⇒ Object
readonly
Called to confirm that the code that has received this message has processed the message to its satisfaction.
-
#data ⇒ String
readonly
The message data associated with this delivery.
-
#malformed ⇒ Malformed
readonly
declared as malformed.
-
#share ⇒ String
readonly
The share name specified when the client subscribed to the destination from which the message was received.
-
#topic ⇒ String
readonly
The topic that the message, delivered by this deliver, was originally sent to.
-
#topic_pattern ⇒ String
readonly
The topic pattern that the client subscribed to in order to receive this message delivery.
-
#ttl ⇒ Integer
readonly
The remaining time to live period for this message in milliseconds.
Instance Method Summary collapse
-
#to_s ⇒ Object
Summary of contains.
Methods included from Logging
Instance Attribute Details
#confirm ⇒ Object (readonly)
Called to confirm that the code that has received this message has processed the message to its satisfaction. When the server receives this confirmation it will make no further attempt to deliver this message to the client and discard its copy of the message.
51 52 53 |
# File 'lib/mqlight/delivery.rb', line 51 def confirm @confirm end |
#data ⇒ String (readonly)
Returns the message data associated with this delivery.
27 28 29 |
# File 'lib/mqlight/delivery.rb', line 27 def data @data end |
#malformed ⇒ Malformed (readonly)
declared as malformed. The structure contains the information associated with the malformed message.
56 57 58 |
# File 'lib/mqlight/delivery.rb', line 56 def malformed @malformed end |
#share ⇒ String (readonly)
Returns the share name specified when the client subscribed to the destination from which the message was received. This property will not be nil if the client subscribed to a private destination.
45 46 47 |
# File 'lib/mqlight/delivery.rb', line 45 def share @share end |
#topic ⇒ String (readonly)
Returns the topic that the message, delivered by this deliver, was originally sent to.
31 32 33 |
# File 'lib/mqlight/delivery.rb', line 31 def topic @topic end |
#topic_pattern ⇒ String (readonly)
Returns the topic pattern that the client subscribed to in order to receive this message delivery.
35 36 37 |
# File 'lib/mqlight/delivery.rb', line 35 def topic_pattern @topic_pattern end |
#ttl ⇒ Integer (readonly)
Returns the remaining time to live period for this message in milliseconds.
39 40 41 |
# File 'lib/mqlight/delivery.rb', line 39 def ttl @ttl end |
Instance Method Details
#to_s ⇒ Object
Returns summary of contains.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/mqlight/delivery.rb', line 108 def to_s info = '{' info << 'data: ' + @data.to_s.force_encoding('UTF-8') unless @data.nil? info << ', topic: ' + @topic.to_s.force_encoding('UTF-8') \ unless @topic.nil? info << ', topic_pattern: ' + @topic_pattern.to_s.force_encoding('UTF-8') unless @topic_pattern.nil? info << ', ttl: ' + @ttl.to_s unless @ttl.nil? info << ', share: ' + @share.to_s.force_encoding('UTF-8') \ unless @share.nil? info << ', confirm: ' + @confirm.to_s unless @confirm.nil? info << ', tracker: ' + @tracker.to_s unless @tracker.nil? info << ', malformed: ' + @malformed.to_s unless @malformed.nil? info << '}' end |