cluster

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort                  = 17946
	MembershipChangeBufferWindow = 1 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	OnMembershipChange func(n, total int)
	// contains filtered or unexported fields
}

Cluster maintains cluster membership and notifies on certain events

func New

func New(port int, seedAddr string) *Cluster

New returns a new Cluster instance that is not connected.

func (*Cluster) Connect

func (c *Cluster) Connect() error

Connect Initializes the Cluster based on a configuration passed via the New function. It then stores the seed address, starts gossiping and listens for gossip.

func (*Cluster) Shutdown

func (c *Cluster) Shutdown()

Shutdown safely shuts down the cluster.

Jump to

Keyboard shortcuts

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