https://github.com/peakle/bees
Memory lightweight goroutines pool
https://github.com/peakle/bees
go golang goroutine-pool pool
Last synced: 27 days ago
JSON representation
Memory lightweight goroutines pool
- Host: GitHub
- URL: https://github.com/peakle/bees
- Owner: peakle
- License: mit
- Created: 2023-02-25T04:35:18.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T06:48:36.000Z (over 1 year ago)
- Last Synced: 2025-02-08T04:26:55.706Z (3 months ago)
- Topics: go, golang, goroutine-pool, pool
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Bees
[](https://github.com/peakle/bees/blob/master/.github/workflows/ci.yml)
[](https://codecov.io/gh/peakle/bees)
[](https://goreportcard.com/report/github.com/peakle/bees)
[](https://pkg.go.dev/github.com/peakle/bees)Bees - simple and lightweight worker pool for go.
## Benchmarks:
### [10m tasks and 500k workers](https://github.com/peakle/bees/blob/master/pool_bench_test.go):
#### WorkerPool:
only 37MB used for 500k workers pool
#### Goroutines:
#### Semaphore:
## Examples:
```go
package mainimport (
"context"
"fmt""github.com/peakle/bees"
)// Example - demonstrate pool usage
func Example() {
pool := bees.Create(context.Background())
defer pool.Close()t := 1
task := func(ctx context.Context) {
t++
fmt.Println(t)
}
pool.Submit(task)
pool.Submit(task)
pool.Submit(task)pool.Wait()
// Output:
// 1
// 2
// 3
}```