Skip to main content

Module watcher

Module watcher 

Source
Expand description

Filesystem watcher utility for session cache invalidation.

Wraps the notify crate with a small abstraction that tracks callbacks per workspace directory. Each callback is triggered when the corresponding .sqry-index file is modified; callers typically use this to invalidate the in-memory cache entry for that workspace.

§RR-10 Gap #3: Bounded Event Queue (DoS Prevention)

Uses a bounded synchronous channel (sync_channel) instead of unbounded channel to prevent memory exhaustion attacks via filesystem event flooding. The queue capacity is configurable via SQRY_WATCH_EVENT_QUEUE environment variable (default: 10,000 events).

Structs§

FileWatcher
Lightweight wrapper around notify for watching .sqry-index files.