Bees - simple and lightweight worker pool for go.
only 37MB used for 500k workers pool
package main
import (
"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
}