Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

delivery-club/bees

Repository files navigation

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
}