workpool

package module
v0.0.0-...-2273d9e Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("workpool has been closed")

Functions

This section is empty.

Types

type WorkFunc

type WorkFunc func(context.Context)

type WorkPool

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

func NewPool

func NewPool() *WorkPool

func NewPoolSize

func NewPoolSize(size int) *WorkPool

func (*WorkPool) Close

func (p *WorkPool) Close() (err error)

func (*WorkPool) Context

func (p *WorkPool) Context() context.Context

func (*WorkPool) Schedule

func (p *WorkPool) Schedule(ctx context.Context, work WorkFunc, delay, period time.Duration) error

func (*WorkPool) Submit

func (p *WorkPool) Submit(ctx context.Context, work WorkFunc) error

Jump to

Keyboard shortcuts

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