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.
264 265 266 267 268 269 270 |
# File 'lib/nanite/packets.rb', line 264 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.
262 263 264 |
# File 'lib/nanite/packets.rb', line 262 def from @from end |
#results ⇒ Object
Returns the value of attribute results.
262 263 264 |
# File 'lib/nanite/packets.rb', line 262 def results @results end |
#to ⇒ Object
Returns the value of attribute to.
262 263 264 |
# File 'lib/nanite/packets.rb', line 262 def to @to end |
#token ⇒ Object
Returns the value of attribute token.
262 263 264 |
# File 'lib/nanite/packets.rb', line 262 def token @token end |
Class Method Details
.json_create(o) ⇒ Object
272 273 274 275 |
# File 'lib/nanite/packets.rb', line 272 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
277 278 279 280 281 282 283 |
# File 'lib/nanite/packets.rb', line 277 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 |