Parent
Part of #1402. Depends on the new Phase 1 (workspace setup).
Goal
Add core::event_bus::EventBus (tokio::sync::broadcast<MetricsSnapshot>) inside the root-level core crate and route the existing real-time monitor event through it. Frontend behavior unchanged.
Workspace Context
After the new Phase 1, core/ is a separate crate at the repo root. Items under core::* in this issue refer to modules inside that crate (core/src/...). src-tauri/ continues to host the Tauri app and depends on the core crate via path.
Scope
- Implement
core::event_bus::EventBus and a MetricsSnapshot payload type in core/src/event_bus.rs (with MetricsSnapshot in core/src/models/).
- Modify
workers::system_monitor::SystemMonitorController (still under src-tauri/src/workers/) to publish to the EventBus via the core crate API instead of calling app.handle() directly for emit.
- Add
app::adapters::window::WindowAdapter under src-tauri/src/app/adapters/window.rs that subscribes to the EventBus and emits the existing HardwareMonitorUpdate Tauri event.
- The
HardwareMonitorUpdate wire format stays unchanged this phase.
Out of Scope
- Moving the collector under
core/ (Phase 3).
- Replacing
HardwareMonitorUpdate with a redesigned payload (deferred).
Definition of Done
- Frontend dashboard updates in real time, indistinguishably from before.
- Inside the collector loop, there is no direct call to
tauri::Emitter::emit or AppHandle::emit.
- A unit test under
core/ exercises EventBus fan-out to multiple subscribers without a Tauri runtime — i.e. cargo test -p <core-crate> passes with no Tauri in the dependency graph.
Parent
Part of #1402. Depends on the new Phase 1 (workspace setup).
Goal
Add
core::event_bus::EventBus(tokio::sync::broadcast<MetricsSnapshot>) inside the root-levelcorecrate and route the existing real-time monitor event through it. Frontend behavior unchanged.Workspace Context
After the new Phase 1,
core/is a separate crate at the repo root. Items undercore::*in this issue refer to modules inside that crate (core/src/...).src-tauri/continues to host the Tauri app and depends on thecorecrate via path.Scope
core::event_bus::EventBusand aMetricsSnapshotpayload type incore/src/event_bus.rs(withMetricsSnapshotincore/src/models/).workers::system_monitor::SystemMonitorController(still undersrc-tauri/src/workers/) to publish to the EventBus via thecorecrate API instead of callingapp.handle()directly for emit.app::adapters::window::WindowAdapterundersrc-tauri/src/app/adapters/window.rsthat subscribes to the EventBus and emits the existingHardwareMonitorUpdateTauri event.HardwareMonitorUpdatewire format stays unchanged this phase.Out of Scope
core/(Phase 3).HardwareMonitorUpdatewith a redesigned payload (deferred).Definition of Done
tauri::Emitter::emitorAppHandle::emit.core/exercises EventBus fan-out to multiple subscribers without a Tauri runtime — i.e.cargo test -p <core-crate>passes with no Tauri in the dependency graph.