scheduler

package
v0.0.0-...-014b5c3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElectRequest

type ElectRequest struct {
	Context  core.Context
	Response chan core.Backend
	Err      chan error
}

*

  • Request to elect backend

type Op

type Op struct {
	// contains filtered or unexported fields
}

*

  • Operation on backend

type OpAction

type OpAction int

*

  • Backend Operation action
const (
	IncrementConnection OpAction = iota
	DecrementConnection
	IncrementRefused
	IncrementTx
	IncrementRx
)

*

  • Constants for backend operation

type Scheduler

type Scheduler struct {

	/* Balancer impl */
	Balancer core.Balancer

	/* Discovery impl */
	Discovery *discovery.Discovery

	/* Healthcheck impl */
	Healthcheck *healthcheck.Healthcheck

	/* Stats */
	StatsHandler *stats.Handler
	// contains filtered or unexported fields
}

*

  • Scheduler

func (*Scheduler) Backends

func (this *Scheduler) Backends() []core.Backend

*

  • Return current backends

func (*Scheduler) DecrementConnection

func (this *Scheduler) DecrementConnection(backend core.Backend)

*

  • Decrement backends connection counter

func (*Scheduler) HandleBackendElect

func (this *Scheduler) HandleBackendElect(req ElectRequest)

*

  • Perform backend election

func (*Scheduler) HandleBackendLiveChange

func (this *Scheduler) HandleBackendLiveChange(target core.Target, live bool)

*

  • Updated backend live status

func (*Scheduler) HandleBackendStatsChange

func (this *Scheduler) HandleBackendStatsChange(target core.Target, bs *counters.BandwidthStats)

*

  • Updated backend stats

func (*Scheduler) HandleBackendsUpdate

func (this *Scheduler) HandleBackendsUpdate(backends []core.Backend)

*

  • Update backends map

func (*Scheduler) HandleOp

func (this *Scheduler) HandleOp(op Op)

*

  • Handle operation on the backend

func (*Scheduler) IncrementConnection

func (this *Scheduler) IncrementConnection(backend core.Backend)

*

  • Increment backend connection counter

func (*Scheduler) IncrementRefused

func (this *Scheduler) IncrementRefused(backend core.Backend)

*

  • Increment connection refused count for backend

func (*Scheduler) IncrementRx

func (this *Scheduler) IncrementRx(backend core.Backend, c uint)

*

  • Increment Rx stats for backend

func (*Scheduler) IncrementTx

func (this *Scheduler) IncrementTx(backend core.Backend, c uint)

*

  • Increment Tx stats for backends

func (*Scheduler) Start

func (this *Scheduler) Start()

*

  • Start scheduler

func (*Scheduler) Stop

func (this *Scheduler) Stop()

*

  • Stop scheduler

func (*Scheduler) TakeBackend

func (this *Scheduler) TakeBackend(context core.Context) (*core.Backend, error)

*

  • Take elect backend for proxying

func (*Scheduler) Targets

func (this *Scheduler) Targets() []core.Target

*

  • Returns targets of current backends

Jump to

Keyboard shortcuts

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