Class: DCell::Message::Heartbeat

Inherits:
DCell::Message show all
Defined in:
lib/dcell/messages.rb

Overview

Heartbeat messages inform other nodes this node is healthy

Instance Attribute Summary

Attributes inherited from DCell::Message

#id

Instance Method Summary collapse

Constructor Details

#initializeHeartbeat

Returns a new instance of Heartbeat.



13
14
15
# File 'lib/dcell/messages.rb', line 13

def initialize
  @id = DCell.id
end

Instance Method Details

#dispatchObject



17
18
19
20
# File 'lib/dcell/messages.rb', line 17

def dispatch
  node = DCell::Node[@id]
  node.handle_heartbeat if node
end