Documentation
¶
Overview ¶
Package horde is an attempt at behaving like erlang for distributed systems.
Lok'tar!
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
sync.Mutex
// Nodes that are about to be added to the horde
StagedNodes []Node
// StageSha is a unique sha that represents the latest StagedNodes
StageSha string
// Nodes that have have been committed in the horde
CommittedNodes []Node
// CommitSha is a unique sha that represents the latest CommittedNodes
CommitSha string
// ReadEpoch is a simple mechanism to keep track of pending or current reads.
// If the ReadEpoch is odd, the Manager is reading.
// If the ReadEpoch is even, the Manager has finished reading.
ReadEpoch int
// WriteEpoch is a simple mechanism to keep track of pending or current writes.
// If the WriteEpoch is odd, the Manager is writting.
// If the WriteEpoch is even, the Manager has finished writting.
WriteEpoch int
// Self contains static information about the node.
// This information is set on boot.
Self Node
}
Manager keeps track of Nodes and Self. Each Manager is self managing. This is a holistic network. For the horde!
func (*Manager) Nodes ¶
Nodes returns a list of known nodes and their network info in the horde. This method will not include Self
func (*Manager) Ping ¶
Ping calls another node that is known to exist. Returns "pong" on success and "pang" on failure ala erlang. If properly load balanced (round robin) it should not matter which node. So we ping the first!
func (*Manager) RemoveSelfFromHorde ¶
RemoveSelfFromHorde is for when the http server fails or is shutdown. Something needs to happen. Gotta clean up the mess. This _will_ make a network call to a known node and remove itself from the horde!