sched

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT, GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(w *Pool)

Option is a scheduler option.

func Randomizer

func Randomizer(f func(min, max int) int) Option

func Workers

func Workers(limit int) Option

type Pool

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

Pool is a worker pool.

func New

func New(opts ...Option) *Pool

New creates a new task scheduler and returns a pool of workers.

func (*Pool) Add

func (p *Pool) Add(numTasks int) int

func (*Pool) IsRunning

func (p *Pool) IsRunning() bool

func (*Pool) Release

func (p *Pool) Release()

func (*Pool) Run

func (p *Pool) Run(f ...func())

Run runs f in the current pool.

func (*Pool) RunWithArgs

func (p *Pool) RunWithArgs(f func(args interface{}), args interface{})

func (*Pool) Running

func (p *Pool) Running() uint64

func (*Pool) Wait

func (p *Pool) Wait()

func (*Pool) WaitAndRelease

func (p *Pool) WaitAndRelease()

Jump to

Keyboard shortcuts

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