Class: Nanite::Register
Overview
packet that means an availability notification sent from actor to mapper
from is sender identity services is a list of services provided by the node status is a load of the node by default, but may be any criteria
agent may use to report it's availability, load, etc
Instance Attribute Summary collapse
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#services ⇒ Object
Returns the value of attribute services.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tags ⇒ Object
Returns the value of attribute tags.
Attributes inherited from Packet
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(identity, services, status, tags, size = nil) ⇒ Register
constructor
A new instance of Register.
- #to_s ⇒ Object
Methods inherited from Packet
Constructor Details
#initialize(identity, services, status, tags, size = nil) ⇒ Register
Returns a new instance of Register.
281 282 283 284 285 286 287 |
# File 'lib/nanite/packets.rb', line 281 def initialize(identity, services, status, , size=nil) @status = status @tags = @identity = identity @services = services @size = size end |
Instance Attribute Details
#identity ⇒ Object
Returns the value of attribute identity.
279 280 281 |
# File 'lib/nanite/packets.rb', line 279 def identity @identity end |
#services ⇒ Object
Returns the value of attribute services.
279 280 281 |
# File 'lib/nanite/packets.rb', line 279 def services @services end |
#status ⇒ Object
Returns the value of attribute status.
279 280 281 |
# File 'lib/nanite/packets.rb', line 279 def status @status end |
#tags ⇒ Object
Returns the value of attribute tags.
279 280 281 |
# File 'lib/nanite/packets.rb', line 279 def @tags end |
Class Method Details
.json_create(o) ⇒ Object
289 290 291 292 |
# File 'lib/nanite/packets.rb', line 289 def self.json_create(o) i = o['data'] new(i['identity'], i['services'], i['status'], i['tags'], o['size']) end |
Instance Method Details
#to_s ⇒ Object
294 295 296 297 298 299 |
# File 'lib/nanite/packets.rb', line 294 def to_s log_msg = "#{super} #{id_to_s(identity)}" log_msg += ", services: #{services.join(', ')}" if services && !services.empty? log_msg += ", tags: #{.join(', ')}" if && !.empty? log_msg end |