Class: Nanite::Result
Overview
packet that means a work result notification sent from actor to mapper
from is sender identity results is arbitrary data that is transferred from actor, a result of actor’s work token is a generated request id that mapper uses to identify replies to is identity of the node result should be delivered to
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#results ⇒ Object
Returns the value of attribute results.
-
#to ⇒ Object
Returns the value of attribute to.
-
#token ⇒ Object
Returns the value of attribute token.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token, to, results, from, size = nil) ⇒ Result
constructor
A new instance of Result.
- #to_s(filter = nil) ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(token, to, results, from, size = nil) ⇒ Result
Returns a new instance of Result.
219 220 221 222 223 224 225 |
# File 'lib/nanite/packets.rb', line 219 def initialize(token, to, results, from, size=nil) @token = token @to = to @from = from @results = results @size = size end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
217 218 219 |
# File 'lib/nanite/packets.rb', line 217 def from @from end |
#results ⇒ Object
Returns the value of attribute results.
217 218 219 |
# File 'lib/nanite/packets.rb', line 217 def results @results end |
#to ⇒ Object
Returns the value of attribute to.
217 218 219 |
# File 'lib/nanite/packets.rb', line 217 def to @to end |
#token ⇒ Object
Returns the value of attribute token.
217 218 219 |
# File 'lib/nanite/packets.rb', line 217 def token @token end |
Class Method Details
.json_create(o) ⇒ Object
227 228 229 230 |
# File 'lib/nanite/packets.rb', line 227 def self.json_create(o) i = o['data'] new(i['token'], i['to'], i['results'], i['from'], o['size']) end |
Instance Method Details
#to_s(filter = nil) ⇒ Object
232 233 234 235 236 237 238 |
# File 'lib/nanite/packets.rb', line 232 def to_s(filter=nil) log_msg = "#{super} <#{token}>" log_msg += " from #{id_to_s(from)}" if filter.nil? || filter.include?(:from) log_msg += " to #{id_to_s(to)}" if filter.nil? || filter.include?(:to) log_msg += " results: #{results.inspect}" if filter.nil? || filter.include?(:results) log_msg end |