Class: Mqlight::Delivery

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from Logging

#logger, logger

Instance Attribute Details

#confirmObject (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

#dataString (readonly)

Returns the message data associated with this delivery.

Returns:

  • (String)

    the message data associated with this delivery



27
28
29
# File 'lib/mqlight/delivery.rb', line 27

def data
  @data
end

#malformedMalformed (readonly)

declared as malformed. The structure contains the information associated with the malformed message.

Returns:

  • (Malformed)

    only present when the received message has been



56
57
58
# File 'lib/mqlight/delivery.rb', line 56

def malformed
  @malformed
end

#shareString (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.

Returns:

  • (String)

    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

#topicString (readonly)

Returns the topic that the message, delivered by this deliver, was originally sent to.

Returns:

  • (String)

    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_patternString (readonly)

Returns the topic pattern that the client subscribed to in order to receive this message delivery.

Returns:

  • (String)

    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

#ttlInteger (readonly)

Returns the remaining time to live period for this message in milliseconds.

Returns:

  • (Integer)

    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_sObject

Returns summary of contains.

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