manager

package
v0.0.0-...-7ec57c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RETRY_INTERVAL                  = 1 * time.Second
	NUM_CONNECTION_RETRIES          = 100
	WAIT_PARTICIPANT_STARTUP_PERIOD = 10 * time.Second

	NUM_HEARTBEAT_RETRIES = 10
	HEARTBEAT_INTERVAL    = 60 * time.Second

	DOMAIN = "localhost"
)

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

func NewManager(numParticipants int, hostport string, binaryPath string) (*Manager, error)

Creates a new manager and starts all the participants

func (*Manager) GetRandomParticipantHostPort

func (m *Manager) GetRandomParticipantHostPort() string

Returns a hostport that belongs to a random participant

func (*Manager) RequestHeartbeats

func (m *Manager) RequestHeartbeats() error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL