-
Release v1.0.0 Stable
released this
2026-05-12 11:51:36 -06:00 | 0 commits to main since this releasev1.0.0
code.nochebuena.dev/go/workerOverview
workerprovides a fixed-size goroutine pool that receives background tasks via a
buffered channel. It integrates withlauncherfor managed startup and graceful
shutdown, and useslogzfor structured logging. Tasks are plain
func(ctx context.Context) errorcallables.v1.0.0 adds
Len() inttoProvider, bumps all micro-lib dependencies to v1,
and commits the API as stable.What Changed Since v0.9.0
New:
Len() intonProvidertype Provider interface { Dispatch(task Task) bool Len() int // current number of queued tasks }Returns the number of tasks currently waiting in the buffer. Use it to observe
backpressure depth or assert queue state in tests.Dependency updates
launcherbumped fromv0.9.0tov1.0.1logzbumped fromv0.9.0tov1.0.1- Go directive bumped from
1.25to1.26
Full API (stable)
Task—func(ctx context.Context) errorConfig—PoolSize,BufferSize,TaskTimeout,ShutdownTimeoutProvider—Dispatch(Task) bool,Len() intComponent— embedslauncher.Component+ProviderNew(logger, cfg) Component
Installation
go get code.nochebuena.dev/go/worker@v1.0.0Changelog
See CHANGELOG.md.
Downloads