Documentation
¶
Overview ¶
Package watchdog forces process exit when the worker heartbeat goes flat with active workload, letting the platform's restart policy recover from latent Go-side wedges (blocked pipe, mutex deadlock, exhausted resource pool).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Defaults: 90s / 15s / 2m.
StallThreshold time.Duration
CheckInterval time.Duration
GracePeriod time.Duration
// HasWork=nil → assume work always exists. Returning false skips
// the staleness check (no jobs alive → can't be wedged).
HasWork func(ctx context.Context) bool
Logger *slog.Logger
// Tests substitute a non-fatal handler. Default os.Exit.
Exit func(code int)
}
Click to show internal directories.
Click to hide internal directories.