Class: Nanite::Result

Inherits:
Packet show all
Defined in:
lib/nanite/packets.rb

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Packet

#to_json

Constructor Details

#initialize(token, to, results, from) ⇒ Result

Returns a new instance of Result.



134
135
136
137
138
139
# File 'lib/nanite/packets.rb', line 134

def initialize(token, to, results, from)
  @token = token
  @to = to
  @from = from
  @results = results
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



133
134
135
# File 'lib/nanite/packets.rb', line 133

def from
  @from
end

#resultsObject

Returns the value of attribute results.



133
134
135
# File 'lib/nanite/packets.rb', line 133

def results
  @results
end

#toObject

Returns the value of attribute to.



133
134
135
# File 'lib/nanite/packets.rb', line 133

def to
  @to
end

#tokenObject

Returns the value of attribute token.



133
134
135
# File 'lib/nanite/packets.rb', line 133

def token
  @token
end

Class Method Details

.json_create(o) ⇒ Object



140
141
142
143
# File 'lib/nanite/packets.rb', line 140

def self.json_create(o)
  i = o['data']
  new(i['token'], i['to'], i['results'], i['from'])
end