pool

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	//对外的Task进入通道
	EntryChannel chan *task.Task

	//对内的Task通道,用来去消费Task
	JobChannel chan *task.Task

	//用来定义协程池内消费任务的worker数,即可理解为需要启动多少个协程来消费任务
	PoolWorkerNum int
}

func CreatePool

func CreatePool(poolWorkerNum int) *Pool

CreatePool 创建一个协程池 @param poolWorkerNum int @return *Pool

func (*Pool) Run

func (p *Pool) Run(taskNum int, isShowOption bool, graph string)

Run 运行协程池 @receiver p *Pool @param taskNum int @param isShowOption bool @param graph string

Jump to

Keyboard shortcuts

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