Skip to main content

Module watcher

Module watcher 

Source
Expand description

File watcher + change classifier for the dev loop.

Wraps notify so the rest of the dev server (the builder in I4e and the Tier 1 patcher in I4g) doesn’t have to deal with raw filesystem events. Three things happen here:

  1. Recursive watch of a package root.
  2. Debounce raw notify events for ~200 ms — a single file save can produce 3-5 notify events on macOS (atomic rename + chmod
    • …); we coalesce them into one Change.
  3. Classify the affected paths into ChangeKind so callers can pick a rebuild strategy (Tier 2 cold rebuild for RustCode, full restart for CargoToml, etc).

Structs§

Change
One debounced change batch.

Enums§

ChangeKind
What sort of change happened. The classifier picks the most disruptive category among the paths in a single debounced batch (Cargo.toml beats Rust code beats anything else).

Functions§

spawn_watcher
Spawn a recursive watcher rooted at each path in roots. Debounced Change batches arrive on tx. The returned RecommendedWatcher keeps the OS watches alive — drop it to stop watching.