hot_reload
hot_reload
¶
Stdlib file watcher backing conductor config hot reload (#408).
Polls the config file and the instrument profile source directories for
CONTENT changes (sha256, not bare mtime — survives editors' atomic
rename-save and in-place rewrites that keep mtime granularity ambiguous)
and funnels detected changes into the single reload path
(DaemonProcess.reload_configuration → JobManager.reload_configuration).
Deliberately dependency-free (MN-005): an asyncio task on a short poll interval with a configurable debounce. Three watched directories do not justify watchdog/inotify.
Classes¶
ConfigWatcher
¶
ConfigWatcher(*, config_file, profile_dirs, class_files=None, reload_fn, enabled_fn=None, debounce_fn=None, poll_interval=1.0)
Content-hash poller over the config file + profile directories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_file
|
Path | None
|
The conductor config file (None watches only profiles). |
required |
profile_dirs
|
list[Path]
|
Instrument profile source directories — the same
directories |
required |
reload_fn
|
ReloadFn
|
Async reload entry — always the single reload path. |
required |
enabled_fn
|
Callable[[], bool] | None
|
Live off-switch read every cycle ( |
None
|
debounce_fn
|
Callable[[], float] | None
|
Live settle window in seconds read every cycle
( |
None
|
poll_interval
|
float
|
Seconds between scans. Kept short so the debounce window, not the poll cadence, defines detection latency. |
1.0
|