routine_pool

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Running = iota
	Pending
	Over
	Idle
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GoWorker

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

type LimitRoutinePool

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

func NewLimitPool

func NewLimitPool(count int, limit int, notice func()) *LimitRoutinePool

type RoutinePool

type RoutinePool struct {
	RunningSheet map[string]*GoWorker
	IdleSheet    map[string]*GoWorker
	RunningChan  chan *GoWorker
	IdleChan     chan *GoWorker
	StatusChan   chan *GoWorker
	TaskFuncChan chan TaskFunc
	// contains filtered or unexported fields
}

func NewPool

func NewPool(count int) *RoutinePool

func (*RoutinePool) GetRunningCount

func (r *RoutinePool) GetRunningCount() int

func (*RoutinePool) Pause

func (r *RoutinePool) Pause()

func (*RoutinePool) Recover

func (r *RoutinePool) Recover()

func (*RoutinePool) Release

func (r *RoutinePool) Release()

func (*RoutinePool) Start

func (r *RoutinePool) Start()

func (*RoutinePool) Submit

func (r *RoutinePool) Submit(task TaskFunc)

type TaskFunc

type TaskFunc func()

Jump to

Keyboard shortcuts

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