Repository navigation
feat: add transparent Warp StreamBus transport - #77
Conversation
|
Post-merge review: the transport direction is sound, but I would keep WebSocket as the production default and address the following before advertising StreamBus as production-ready. 1. P1 — outbound backpressure can break SSC ordering
The subscription uses There is a related invalid-payload failure: StreamBus marshals only after Recommended direction: reuse the WebSocket writer invariants from #71. Validate/marshal before sequencing, perform a truly non-blocking enqueue per connection, apply a write deadline, and on queue overflow or write failure close that connection with a best-effort Required regression: two StreamBus subscribers, one that stops reading and one healthy. Broadcast must return promptly, the healthy subscriber must receive every frame in order, the slow subscriber must be disconnected, and resume must replay the complete sequence. Also prove that an invalid outbound payload does not consume a sequence number or poison replay. 2. P1 — the second replay journal grows with historical connectionsEvery connection gets a unique topic, while the endpoint enables a 256-frame Warp replay journal: In Warp v2.1.0, publishing creates a replay entry per topic, while closing/removing a subscription removes only the subscriber and not the topic journal:
RFW already owns the authoritative sequenced replay in Required regression: repeated connect/send/disconnect cycles must return subscription/topic/journal counts to their baseline and retain no per-connection payloads. 3. P1 release gate — merged
|
|
Thanks. I split the release-blocking items into #83 and opened #84. Some findings were worth fixing, but the framing was off:
Please review #84. |
Summary
This PR adds Warp StreamBus as an alternative transport to WebSocket in RFW.
StreamBus uses WebTransport over HTTP/3 while preserving the existing SSC protocol and public APIs. Applications can enable it without changing components, events, calls, hydration, broadcasts, or session-resumption logic.
WebSocket remains available as the default transport and transparent fallback when WebTransport is unavailable.
Configuration
Enable StreamBus in
rfw.json:{ "transport": "streambus" }Or through an environment variable:
Supported values:
websocketstreambusautoImplementation
/streambusWebTransport endpoint backed by Warp StreamBus./wsavailable as a transparent fallback.RFW_TRANSPORTandrfw.json.rfw_config.js.Compatibility
No application-level API changes are required.
The following features work through both transports:
SendCallPerformance
Producer-side fanout benchmark using distinct SSC JSON serialization and one publication per target session:
At 100 subscribers:
Environment: Go 1.25.0, AMD EPYC 9V74, median of five one-second benchmark runs.
These results measure server-side publication and fanout overhead. They do not imply that every WebTransport network round trip will always be faster than WebSocket.
Validation
go test ./...go test -race ./...go vet ./...