concurrent

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PoolShutDownError = errors.New("RoutinePool is shutdown!")
View Source
var SubmitTimeoutError = errors.New("Submit task timeout!")
View Source
var TaskInvalid = errors.New("Task is nil!")
View Source
var TaskRejectError = errors.New("Submit task is rejected!")

Functions

This section is empty.

Types

type Future

type Future interface {
	Get() interface{}
}

type FutureResult

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

func (*FutureResult) Get

func (f *FutureResult) Get() interface{}

type NoChanPool

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

func (*NoChanPool) AddCurrentWorkingCnt

func (pool *NoChanPool) AddCurrentWorkingCnt(value int64) int64

func (*NoChanPool) AddMaxWorkerCnt

func (pool *NoChanPool) AddMaxWorkerCnt(value int64) int64

func (*NoChanPool) AddWorkerCnt

func (pool *NoChanPool) AddWorkerCnt(value int64) int64

func (*NoChanPool) CompareAndSwapCurrentWorkingCnt

func (pool *NoChanPool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool

func (*NoChanPool) Execute

func (pool *NoChanPool) Execute(t Task)

func (*NoChanPool) ExecuteFunc

func (pool *NoChanPool) ExecuteFunc(f func() interface{})

func (*NoChanPool) GetCurrentWorkingCnt

func (pool *NoChanPool) GetCurrentWorkingCnt() int64

func (*NoChanPool) GetMaxWorkerCnt

func (pool *NoChanPool) GetMaxWorkerCnt() int64

func (*NoChanPool) GetWorkerCnt

func (pool *NoChanPool) GetWorkerCnt() int64

func (*NoChanPool) ShutDown

func (pool *NoChanPool) ShutDown()

func (*NoChanPool) Submit

func (pool *NoChanPool) Submit(t Task) (Future, error)

func (*NoChanPool) SubmitFunc

func (pool *NoChanPool) SubmitFunc(f func() interface{}) (Future, error)

type Pool

type Pool interface {
	ShutDown()
	Submit(t Task) (Future, error)
	SubmitFunc(f func() interface{}) (Future, error)
	Execute(t Task)
	ExecuteFunc(f func() interface{})
	GetMaxWorkerCnt() int64
	AddMaxWorkerCnt(value int64) int64
	GetCurrentWorkingCnt() int64
	AddCurrentWorkingCnt(value int64) int64
	GetWorkerCnt() int64
	AddWorkerCnt(value int64) int64
}

func NewNochanPool

func NewNochanPool(maxWorkerCnt int) Pool

func NewRoutinePool

func NewRoutinePool(maxWorkerCnt, cacheCnt int) Pool

type RoutinePool

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

func (*RoutinePool) AddCurrentWorkingCnt

func (pool *RoutinePool) AddCurrentWorkingCnt(value int64) int64

func (*RoutinePool) AddMaxWorkerCnt

func (pool *RoutinePool) AddMaxWorkerCnt(value int64) int64

func (*RoutinePool) AddWorkerCnt

func (pool *RoutinePool) AddWorkerCnt(value int64) int64

func (*RoutinePool) CompareAndSwapCurrentWorkingCnt

func (pool *RoutinePool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool

func (*RoutinePool) Execute

func (pool *RoutinePool) Execute(t Task)

func (*RoutinePool) ExecuteFunc

func (pool *RoutinePool) ExecuteFunc(f func() interface{})

func (*RoutinePool) GetCurrentWorkingCnt

func (pool *RoutinePool) GetCurrentWorkingCnt() int64

func (*RoutinePool) GetMaxWorkerCnt

func (pool *RoutinePool) GetMaxWorkerCnt() int64

func (*RoutinePool) GetWorkerCnt

func (pool *RoutinePool) GetWorkerCnt() int64

func (*RoutinePool) ShutDown

func (pool *RoutinePool) ShutDown()

func (*RoutinePool) Submit

func (pool *RoutinePool) Submit(t Task) (Future, error)

func (*RoutinePool) SubmitFunc

func (pool *RoutinePool) SubmitFunc(f func() interface{}) (Future, error)

func (*RoutinePool) SubmitWithTimeout

func (pool *RoutinePool) SubmitWithTimeout(t Task, timeout int64) (Future, error)

type Task

type Task interface {
	Run() interface{}
}

Jump to

Keyboard shortcuts

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