Producers are event *sources* — the renderer is everything inside training/dashboard/. Sibling layout makes the dependency direction one-way (producers import from training.dashboard.events; dashboard never reaches into producers). training/dashboard/producers/ → training/producers/ Internal imports rewritten via sed; eval_/run.py and training/README.md cross-references updated. CLI entry stays via `python -m training.producers.<sub>` (replay / metrics / perf / profiles). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 lines
573 B
Python
12 lines
573 B
Python
"""Live producers — Python functions that emit dashboard events.
|
|
|
|
Each producer takes an async ``publish(msg: dict) -> None`` callable so it
|
|
doesn't care whether messages go through the in-process broadcaster
|
|
(``training.dashboard.app.broadcaster.publish``) or a loopback HTTP POST
|
|
to ``/publish``. The ``_publish`` module wires up either transport.
|
|
|
|
Event contracts match the JS subscribers in
|
|
``training/dashboard/static/dashboard.js`` — see the comment block at the
|
|
top of that file. Adding a new event type requires both a producer here
|
|
and a subscriber there.
|
|
"""
|