https://github.com/xialeistudio/goroutine-pool
golang general goroutine pool
https://github.com/xialeistudio/goroutine-pool
Last synced: 2 months ago
JSON representation
golang general goroutine pool
- Host: GitHub
- URL: https://github.com/xialeistudio/goroutine-pool
- Owner: xialeistudio
- License: mit
- Created: 2018-08-08T02:54:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-10T11:52:20.000Z (almost 6 years ago)
- Last Synced: 2025-06-12T00:08:41.215Z (6 months ago)
- Language: Go
- Size: 2.93 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golang通用协程池
简化协程管理
## 实现功能
+ 限制协程数量
+ 阻塞等待指定数量任务执行(sync.WaitGroup)
## 使用方法
```go
pool := New(2, 4) // 初始化一个总数为4,并发数为2的协程池
pool.Submit(func() {
time.Sleep(time.Second) // 提交任务
})
// 等待所有协程执行完毕
pool.Wait()
```
## 个人博客
[每天进步一点点](https://www.ddhigh.com)