1mb

build with

goflow

Go rate limiters, worker pools, cron

Rate limiting, task scheduling and streaming in one Go library. Token bucket, leaky bucket and concurrency limiters. Worker pools, pipelines, and a scheduler that takes intervals or six-field cron, seconds included. Streams with four backpressure strategies.

A token bucket at rate 10 and burst 20 lets 20 through at once, then 10 a second.

Shutdown lets running tasks finish. Queued tasks can be dropped, with no error.

why it exists

A project needed a token bucket, a worker pool and a scheduler.

goflow makes them primitives to import.

what it taught

A library can say when not to use it. The README sends a reader with one need to a single-purpose library, and to sync.WaitGroup and channels when those are enough.

Source is public.

get goflow docs

related

all work