You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[arch] Add event-bus ring buffer + replay when first late-joiner ships #129
The desktop event bus (crates/app/src/bus.rs) currently exposes subscribe() returning a fresh Receiver<AppEvent> with no historical
events. This works in v1 because every subscriber spawns at app launch
before any event fires.
A future shell that connects to a running backend after-the-fact (mobile
app, HTTP/WebSocket service, browser extension) would miss every event
that fired before its subscription. The original recommendation
was a 256-event ring buffer to support replay on subscribe.
Decision in v1
Skipped. Adding the buffer with no consumer ships dead code, and the
exact replay-cursor shape (per-connection seek? timestamp filter?
key-based?) is best decided by whoever first needs replay.
When to add
When a concrete late-joiner consumer ships. The implementer at that
point owns:
Adding Mutex<VecDeque<AppEvent>> (capacity 256) to Bus.
Pushing to the buffer in Bus::emit AFTER the broadcast.
Exposing a Bus::replay() -> Vec<AppEvent> (or shape they need).
Designing the cursor API based on the consumer's reconnect pattern.
The Bus rustdoc references this issue so the deferral is discoverable
from the codebase.
Activity