worker

package
v0.0.0-...-50a54d8 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitPool

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

LimitPool 带并发控制的协程池

func NewLimitPool

func NewLimitPool(capacity int) *LimitPool

NewLimitPool 新的LimitPool

func (*LimitPool) Add

func (p *LimitPool) Add(task func())

Add 增加新任务

func (*LimitPool) Stop

func (p *LimitPool) Stop()

Stop 结束任务

type StaticPool

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

StaticPool 固定协程个数的协程池

func NewStaticPool

func NewStaticPool(capacity int) *StaticPool

NewStaticPool 初始化固定容量的协程池

func (*StaticPool) Add

func (p *StaticPool) Add(task func())

Add 新增任务

func (*StaticPool) Stop

func (p *StaticPool) Stop()

Stop 结束任务

Jump to

Keyboard shortcuts

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