Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
BinaryPath string
Participants map[int]*Participant
HostPorts map[int]string
// contains filtered or unexported fields
}
Manages participants Replaces dead participants Provides hostports for clients
func NewManager ¶
Creates a new manager and starts all the participants
func (*Manager) GetRandomParticipantHostPort ¶
Returns a hostport that belongs to a random participant
func (*Manager) RequestHeartbeats ¶
Requests heartbeats from participants
type Participant ¶
type Participant struct {
ID int
HostPort string
Client *rpc.Client
// contains filtered or unexported fields
}
func NewParticipant ¶
func NewParticipant(binaryPath string, id int, hostports map[int]string, replace bool) (*Participant, error)
Create and start participant binary
func (*Participant) Connect ¶
func (p *Participant) Connect(numRetries int) error
Connect to participant
func (*Participant) SendHeartbeat ¶
func (p *Participant) SendHeartbeat() error
Checks if participant is alive
Click to show internal directories.
Click to hide internal directories.