delivery-club / bees

Lightweight worker pool for go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
}

About

Lightweight worker pool for go

License:MIT License


Languages

Language:Go 97.1%Language:Makefile 1.8%Language:Shell 1.0%