schedule

package
v0.0.0-...-cb4208f Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceScheduler

type InterfaceScheduler interface {
	Start(ctx context.Context, wg *sync.WaitGroup, readyChan chan<- string)

	GetNextQueue() (queueName string, found bool)

	UpdateJobCost(queueName string, jobCost float64)
}

InterfaceScheduler ...

type Lottery

type Lottery struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Lottery ...

func NewLotteryScheduler

func NewLotteryScheduler(c *config.BrokerConfig, sa *stats.StatisticAgent, logger *zap.Logger) *Lottery

NewLotteryScheduler ...

func (*Lottery) GetNextQueue

func (lt *Lottery) GetNextQueue() (queueName string, found bool)

GetNextQueue ..

func (*Lottery) Start

func (lt *Lottery) Start(ctx context.Context, wg *sync.WaitGroup, readyChan chan<- string)

Start do re-assign the tickets everytime that Statistic changed

func (*Lottery) UpdateJobCost

func (lt *Lottery) UpdateJobCost(queueName string, jobCost float64)

UpdateJobCost ...

Jump to

Keyboard shortcuts

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