spawn_wave_obj_bridge

Function spawn_wave_obj_bridge 

Source
pub fn spawn_wave_obj_bridge(
    events_rx: Receiver<Event>,
    wstore: Arc<WaveStore>,
    event_bus: Arc<EventBus>,
) -> JoinHandle<()>
Expand description

Spawn the bridge task. Returns the JoinHandle so callers can keep it alive (typically forever — the task lives for the lifetime of the srv process). Per ReAgent P1 on PR #852: the loop is panic-resilient — a panic inside dispatch_event is caught and logged, and the loop continues processing subsequent events. Without this, a single malformed event could silently kill the entire bridge task and frontend WOS would stop seeing updates.

Subscribe ordering: per SPEC §11.1 the bridge can subscribe in any order relative to the persist subscriber. For Phase 1’s workspace events the HTTP RPC handler applies SQLite synchronously before publishing the event, so the bridge always sees post-event state.