lbp

package
Version: v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadBalancePolicy

type LoadBalancePolicy interface {
	Choose(peers []fab.Peer) (fab.Peer, error)
}

LoadBalancePolicy chooses a peer from a set of peers

type Random

type Random struct {
}

Random implements a random load-balance policy

func NewRandom

func NewRandom() *Random

NewRandom returns a new Random load-balance policy

func (*Random) Choose

func (lbp *Random) Choose(peers []fab.Peer) (fab.Peer, error)

Choose randomly chooses a peer from the list of peers

type RoundRobin

type RoundRobin struct {
	sync.Mutex
	// contains filtered or unexported fields
}

RoundRobin implements a round-robin load-balance policy

func NewRoundRobin

func NewRoundRobin() *RoundRobin

NewRoundRobin returns a new RoundRobin load-balance policy

func (*RoundRobin) Choose

func (lbp *RoundRobin) Choose(peers []fab.Peer) (fab.Peer, error)

Choose chooses from the list of peers in round-robin fashion

Jump to

Keyboard shortcuts

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