Tasks

A small in-process scheduler for Go tasks that need to run on time.
Tasks is built for recurring, quick-running jobs where scheduler-induced jitter needs to stay low and the scheduler
should stay out of the way. Each invocation runs in its own goroutine, so one slow task does not make the whole schedule
trip over its shoelaces.
Use Tasks when you want recurring work without cron wiring, a worker fleet, or a pile of scheduling boilerplate.
It is an in-process scheduler, not a durable queue or distributed job runner; if your process exits, your schedule exits
with it. That tradeoff keeps the package small, fast, and easy to reason about.
Install
go get github.com/madflojo/tasks
Why Tasks
- Accurate recurring execution: Each invocation runs independently, so a long-running task does not block unrelated schedules.
- Small API: Intervals use Go's
time.Duration; no custom cron language required.
- Delayed and one-time runs: Use
StartAfter and RunOnce for jobs that should begin later or run just once.
- Overlap control: Use
RunSingleInstance to skip a run when the previous invocation is still working. No dogpiling.
- Task context support: Pass user-defined context and task metadata into callbacks with
FuncWithTaskContext, ErrFuncWithTaskContext, and TaskContext.ID().