package
module
Version:
v0.0.0-...-6d8ade2
Opens a new window with list of versions in this module.
Published: Nov 10, 2024
License: MulanPSL-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Pool 线程池
threaderNum 开启线程数量,范围1~可用的逻辑 CPU 数
inChan 输入通道
outChan 输出通道
arg 用户配置
NewPool 创建线程池
threaderNum 开启线程数量,范围1~可用的逻辑 CPU 数
arg 用户配置
func (p *Pool) Run(productFun func() []any, consumerFun func(int, any), handleFun func(any) any)
Run 运行
productFun 生产者函数 返回待处理数据集切片
consumerFun 消费者函数,入参为索引和处理者返回数据
handleFun 处理者函数,入参为生产者返回数据集中的每个元素
Source Files
¶
Click to show internal directories.
Click to hide internal directories.