Files
2025-08-12 06:37:16 -07:00

25 lines
923 B
Go

package backgroundtask
import "errors"
// Package errors that can be returned by the runner.
var (
// ErrStopped is returned when operations are attempted on a stopped runner.
ErrStopped = errors.New("runner is stopped")
// ErrShutdownTimeout is returned when shutdown exceeds the timeout.
ErrShutdownTimeout = errors.New("shutdown timeout exceeded")
// ErrAlreadyRunning is returned when Run is called on an already running runner.
ErrAlreadyRunning = errors.New("runner is already running")
// ErrNilConfig is returned when Initialize is called with a nil config.
ErrNilConfig = errors.New("config cannot be nil")
// ErrNilWorkFunc is returned when Initialize is called with a nil work function.
ErrNilWorkFunc = errors.New("work function cannot be nil")
// ErrInvalidInterval is returned when an invalid interval is specified.
ErrInvalidInterval = errors.New("interval must be between 1ms and 24h")
)