mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 22:35:08 +00:00
feat(ipc): control socket stage 3 - a state stream replaces polled cache keys (#735)
Adds state.get / state.subscribe to the display's control socket (StateHub in src/ipc/server.py). The web interface holds one subscription per process (web_interface/display_state.py) and reads current-status, on-demand status, plugin runtime and /health's display_loop from it, falling back to the cache keys and heartbeat file. While the socket serves readers, display_current_state and plugin_runtime_snapshot are written less often (about 1.5 instead of 5 cache writes a minute for 15 s screens). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -998,12 +998,14 @@ def _run_startup_reconciliation() -> None:
|
||||
|
||||
try:
|
||||
from src.plugin_system.state_reconciliation import StateReconciliation
|
||||
from src.plugin_system.plugin_runtime import read_plugin_runtime
|
||||
# The display's runtime view: its control socket's state stream when
|
||||
# it serves one, else the cache snapshot (both judged the same way).
|
||||
from web_interface.blueprints.api_v3 import _plugin_runtime_view
|
||||
reconciler = StateReconciliation(
|
||||
config_manager=config_manager,
|
||||
plugins_dir=plugins_dir,
|
||||
store_manager=plugin_store_manager,
|
||||
runtime_source=lambda: read_plugin_runtime(api_v3.cache_manager),
|
||||
runtime_source=_plugin_runtime_view,
|
||||
)
|
||||
result = reconciler.reconcile_state()
|
||||
if result.inconsistencies_found:
|
||||
|
||||
Reference in New Issue
Block a user