observer
observer
¶
Job observer — filesystem and process tree monitoring co-task.
Watches each running job's workspace for file changes (via watchfiles) and monitors the process tree (via psutil) to produce ObserverEvents independently of the runner's self-reports. Events are published to the EventBus for downstream consumers (SSE dashboard, learning hub).
Classes¶
JobObserver
¶
Async co-task that monitors a job's workspace and process tree.
Lifecycle
observer = JobObserver(job_id, workspace, pid, event_bus) await observer.start()
... runs until job completes ...¶
await observer.stop()
Produces events
observer.file_created/observer.file_modified/observer.file_deletedobserver.process_spawned/observer.process_exited
Source code in src/marianne/daemon/observer.py
Attributes¶
Functions¶
start
async
¶
Start filesystem and process monitoring tasks.
Source code in src/marianne/daemon/observer.py
stop
async
¶
Stop both monitoring tasks gracefully.