task

package module
v1.20220225.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 4 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCanceled

func IsCanceled(cc Canceller) bool

Types

type Cancel

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

func NewCancel

func NewCancel() *Cancel

func (*Cancel) AsContext

func (c *Cancel) AsContext() context.Context

func (*Cancel) Cancel

func (c *Cancel) Cancel()

func (*Cancel) RecvCancel

func (c *Cancel) RecvCancel() <-chan struct{}

type CancelContext

type CancelContext Cancel

func (*CancelContext) Deadline

func (cc *CancelContext) Deadline() (time.Time, bool)

func (*CancelContext) Done

func (cc *CancelContext) Done() <-chan struct{}

func (*CancelContext) Err

func (cc *CancelContext) Err() error

func (*CancelContext) Value

func (*CancelContext) Value(key interface{}) interface{}

type Canceller

type Canceller interface {
	Cancel()
	RecvCancel() <-chan struct{}
	AsContext() context.Context
}

type Finish

type Finish Cancel

func NewFinish

func NewFinish() *Finish

func (*Finish) AsCanceller

func (f *Finish) AsCanceller() Canceller

func (*Finish) AsContext

func (f *Finish) AsContext() context.Context

func (*Finish) Done

func (f *Finish) Done()

func (*Finish) RecvDone

func (f *Finish) RecvDone() <-chan struct{}

type Finisher

type Finisher interface {
	Done()
	RecvDone() <-chan struct{}
	AsContext() context.Context
}

type Mission

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

func NewMission

func NewMission() *Mission

func (*Mission) Abort

func (m *Mission) Abort()

func (*Mission) Activate

func (m *Mission) Activate()

func (*Mission) AsContext

func (m *Mission) AsContext() context.Context

func (*Mission) Cancel

func (m *Mission) Cancel()

func (*Mission) Done

func (m *Mission) Done()
func (m *Mission) Link(cc Canceller)

func (*Mission) New

func (p *Mission) New() *Mission

func (*Mission) NewCancel

func (p *Mission) NewCancel() Canceller

func (*Mission) NowaitDone

func (m *Mission) NowaitDone()

func (*Mission) Parson

func (m *Mission) Parson() *Mission

func (*Mission) Recv

func (m *Mission) Recv() <-chan struct{}

func (*Mission) RecvCancel

func (m *Mission) RecvCancel() <-chan struct{}

func (*Mission) RecvDone

func (m *Mission) RecvDone() <-chan struct{}

type MissionContext

type MissionContext Mission

func (*MissionContext) Deadline

func (c *MissionContext) Deadline() (time.Time, bool)

func (*MissionContext) Done

func (c *MissionContext) Done() <-chan struct{}

func (*MissionContext) Err

func (c *MissionContext) Err() error

func (*MissionContext) Value

func (*MissionContext) Value(key interface{}) interface{}

type Pool

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

func NewPool

func NewPool(m *Mission, cnt int) *Pool

func (*Pool) Cancel

func (p *Pool) Cancel()

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) Do

func (p *Pool) Do(f PoolFunc, m *Mission, args ...interface{})

func (*Pool) Recv

func (p *Pool) Recv() <-chan struct{}

func (*Pool) WeakDo

func (p *Pool) WeakDo(f PoolWeakFunc, args ...interface{})

type PoolFunc

type PoolFunc func(*Mission, ...interface{})

type PoolWeakFunc

type PoolWeakFunc func(...interface{})

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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