Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Watchexec: Orientation

File watcherTokio + process supervisionRevision d941d56

Watchexec converts noisy operating-system events into deliberate child-process transitions. Its center is not filesystem watching alone: it is the policy boundary between event collection and a separately owned process state machine.

notify callback / signal / keyboard → priority event channel
                                      ↓ filter + throttle
                                 ActionHandler
                                      ↓ job controls
                              supervised child process

Design thesis

Watchexec turns unreliable bursts of observations into serialized policy decisions, while each child process is owned by an independent supervisor task that accepts explicit, prioritized controls.

  • Bounded event admission makes overload observable.
  • Debouncing coalesces implementation noise into one user-level action.
  • Action handlers propose transitions and commit them by returning.
  • Process groups, signals, timers, and reaping stay inside job supervision.

We preserve prioritized events, filtering, trailing-edge collection, action snapshots, job handles, busy-update policy, graceful signal escalation, error severity, and structured task shutdown.