Skip to main content
Version: 0.1

go-worker

A high-performance, zero-dependency worker pool for Go with retries, scheduling, and observability.

go get github.com/KARTIKrocks/go-worker

What you get​

Worker poolA fixed number of goroutines pulling from a bounded queue
RetriesExponential backoff, a delay cap, jitter, per-attempt timeouts, and permanent errors
Panic recoveryA panicking job fails with its stack trace; the worker keeps running
Graceful shutdownDrain everything on Close, or force-cancel after a timeout
Middleware & hooksWrap every attempt, and observe job and worker lifecycles
Typed futuresGeneric async results with SubmitTyped and Future[T]
Groups & batchesFan-out/fan-in with all errors or cancel-on-first-error, and chunked bulk work
SchedulerCron expressions, intervals, daily times, and one-shot tasks
Flow controlTicker, debouncer, throttler, and rate limiter
MetricsAtomic counters, success rate, and throughput
Zero dependenciesStandard library only

Everything is built on one Pool: groups, futures, the scheduler, and the flow-control helpers all submit their work to a pool you create and own, so one set of limits, retries, and metrics covers all of it.

Where to go next​

Documentation layout​

These guides explain concepts, patterns, and configuration. For exact type signatures, method sets, and struct fields, use pkg.go.dev — it is generated from the source and is always authoritative.

Requirements​

Go 1.27 or later.

go-worker is pre-1.0. Minor releases may contain breaking changes; each one is listed in the changelog.