Documentation
¶
Overview ¶
Package reaper provides zombie process detection and reaping for worker subprocesses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Interval is how often the reaper checks for zombies. Defaults to 30s if zero.
Interval time.Duration
// OnReap is called on each reap cycle (before per-PID callbacks).
// Used for periodic-check testing without a detector.
OnReap func()
// Detector provides zombie PID discovery. If nil, the default syscall-based
// detector is used on Unix, and a no-op detector is used elsewhere.
Detector ZombieDetector
// OnReapPID is called when a zombie PID is reaped. Optional.
OnReapPID func(pid int)
}
Config holds configuration for the Reaper.
type Reaper ¶
type Reaper struct {
// contains filtered or unexported fields
}
Reaper periodically detects and reaps zombie child processes.
type ZombieDetector ¶
type ZombieDetector interface {
// DetectZombies returns a list of zombie PIDs.
DetectZombies() []int
}
ZombieDetector detects zombie child processes.
Click to show internal directories.
Click to hide internal directories.