Skip to content

Repository files navigation

Bees

TestscodecovGo Report CardGo Reference

Bees - simple and lightweight worker pool for go.

Benchmarks:

WorkerPool:

WorkerPoolBench

only 37MB used for 500k workers pool

Goroutines:

GoroutinesBench

Semaphore:

SemaphoreBench

Examples:

package main
import (
"context""fmt""github.com/peakle/bees"
)
// Example - demonstrate pool usagefuncExample() {
pool:=bees.Create(context.Background())
deferpool.Close()
t:=1task:=func(ctx context.Context) {
t++fmt.Println(t)
}
pool.Submit(task)
pool.Submit(task)
pool.Submit(task)
pool.Wait()
// Output:// 1// 2// 3
}

About

Memory lightweight goroutines pool

Topics

Resources

Code of conduct

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages