/bees

Lightweight worker pool for go

Primary LanguageGoMIT LicenseMIT

Project is archived. For actual code look at: https://github.com/peakle/bees

Bees

codecov Go Report Card Go Reference

Bees - simple and lightweight worker pool for go.

Benchmarks:

WorkerPool:

WorkerPoolBench

only 37MB used for 500k workers pool

Gorutines:

GoroutinesBench

Semaphore:

SemaphoreBench

Examples:

// Example - demonstrate pool usage
func Example() {
    pool := Create(context.Background(),
        func(ctx context.Context, task interface{}) { fmt.Println(task) },
    )

    defer pool.Close()

    pool.Submit(1)
    pool.Submit(2)
    pool.Submit(3)

    // Output:
    // 1
    // 2
    // 3
}