Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peakle/bees
Memory lightweight goroutines pool
https://github.com/peakle/bees
go golang goroutine-pool pool
Last synced: 7 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 (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T06:48:36.000Z (about 1 year ago)
- Last Synced: 2024-10-27T23:44:20.564Z (about 2 months ago)
- Topics: go, golang, goroutine-pool, pool
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 1
- 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
[![Tests](https://github.com/peakle/bees/workflows/Tests/badge.svg)](https://github.com/peakle/bees/blob/master/.github/workflows/ci.yml)
[![codecov](https://codecov.io/gh/peakle/bees/branch/master/graph/badge.svg)](https://codecov.io/gh/peakle/bees)
[![Go Report Card](https://goreportcard.com/badge/github.com/peakle/bees)](https://goreportcard.com/report/github.com/peakle/bees)
[![Go Reference](https://pkg.go.dev/badge/github.com/peakle/bees.svg)](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
}```