Documentation
¶
Overview ¶
Package proctracker provides process exit tracking using pidfd_open on Linux 5.3+. Falls back to polling when pidfd is unavailable.
Index ¶
Constants ¶
View Source
const PollInterval = 2 * time.Second
PollInterval is the default interval for fallback polling.
Variables ¶
View Source
var ErrProcessNotFound = errors.New("process not found")
ErrProcessNotFound is returned when a process doesn't exist.
Functions ¶
This section is empty.
Types ¶
type ExitCallback ¶
type ExitCallback func(pid int)
ExitCallback is called when a tracked process exits.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker monitors processes and calls callbacks when they exit.
func New ¶
func New() *Tracker
New creates a new process tracker. It automatically detects whether pidfd_open is available.
func (*Tracker) Stop ¶
func (t *Tracker) Stop()
Stop stops all tracking and waits for goroutines to finish.
Click to show internal directories.
Click to hide internal directories.