Marketplace
worker
1h agotogo worker: supervised multi-threaded worker pools
Infrastructure
worker
Enableddownloads
0
Supervised, multi-threaded background workers for togo. Register a worker with a concurrency, and the manager runs a goroutine pool with panic recovery, backoff restarts, and graceful shutdown.
bash
togo install togo-framework/workergo
import "github.com/togo-framework/worker"
func init() {
worker.Register("emails", 4, func(ctx context.Context) error {
// pull a job and process it; return to be restarted, or block until ctx done
return nil
})
}