1 Star 0 Fork 0

G_night / go-agopool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.md 370 Bytes
一键复制 编辑 原始数据 按行查看 历史
G_night 提交于 2021-06-13 17:59 . update README.md.

go-agopool

介绍

Goroutine 协程池实现

控制协程数目

分为阻塞式 和 非阻塞模式

func demo() {
	pool := agopool.NewPool()
	var sum int64 = 0
	add := func(v ...interface{}) {
		atomic.AddInt64(&sum, 1)
	}
	for i := 1; i < 1000000; i++ {
		pool.Put(add, nil, nil)
	}
	pool.Close()
	fmt.Println("demo = ", sum)
}
1
https://gitee.com/g_night/go-agopool.git
git@gitee.com:g_night/go-agopool.git
g_night
go-agopool
go-agopool
master

搜索帮助