diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-09-15 21:50:34 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-09-15 22:01:20 -0400 |
| commit | ae04a5605b939709552f9ecac91f00e734813980 (patch) | |
| tree | f9e187bb4c5c9702ca62f4602cb21cda802546d7 /Cargo.lock | |
| parent | 5249aad35741f6f029c442a04d679937fb91d2bb (diff) | |
Consolidate channel events into a single stream endpoint.
While reviewing [MDN], I noticed this note:
> SSE suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a very low number (6). […] This limit is per browser + domain, so that means that you can open 6 SSE connections across all of the tabs to www.example1.com and another 6 SSE connections to www.example2.com.
I tested it in Safari; this is true, and once six streams are open, _no_ more requests can be made - in any tab, even a fresh one.
Since the design _was_ that each channel had its own events endpoint, this is an obvious operations risk. Any client that tries to read multiple channels' streams will hit this limit quickly.
This change consolidates all channel events into a single endpoint: `/events`. This takes a list of channel IDs (as query parameters, one `channel=` param per channel), and streams back events from all listed channels. The previous `/:channel/events` endpoint has been removed. Clients can selectively request events for the channels they're interested in.
[MDN]: https://developer.mozilla.org/en-US/docs/Web/API/EventSource
Diffstat (limited to 'Cargo.lock')
| -rw-r--r-- | Cargo.lock | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -210,6 +210,7 @@ dependencies = [ "mime", "pin-project-lite", "serde", + "serde_html_form", "tower", "tower-layer", "tower-service", @@ -1525,6 +1526,19 @@ dependencies = [ ] [[package]] +name = "serde_html_form" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de514ef58196f1fc96dcaef80fe6170a1ce6215df9687a93fe8300e773fefc5" +dependencies = [ + "form_urlencoded", + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] name = "serde_json" version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" |
