forge
Explore
Log in

Don't you dare go Hollow

A page opens one stream per data-live URL

Browse files at this commit

9348d6d76fec9a736d2c95f3e82d5d81732acb83Ahmet Kaan GümüşParent: 59f4261
  • docs
    • a page opens one stream per data-live URL
Show full message
📝 docs: a page opens one stream per data-live URL
docs/architecture.mdmodified+2 -0
@@ -263,6 +263,8 @@ Pages update without a reload. A write that changes what a page shows calls `Liv
263263
264264 The user topics are keyed by user id, and their streams take the viewer from the session, so no URL names another user's inbox. Repo streams follow the same visibility as the repo page (a private repo answers 404 to a viewer who cannot read it). Explore lists public repos only.
265265
266+A page can hold several streams at once: the repo header (`/{owner}/{repo}/events`) sits above the page's own list, issue, pull or run. `nav.js` opens one EventSource for each distinct `data-live` URL in the page, so each of them updates the page.
267+
266268 ### 5.8 Restart resilience
267269
268270 A page survives a server restart without a reload by hand. Every page holds one stream to `GET /-/alive` (no login, no data). The stream sends `retry: 1000` first, and every event stream sent through `events_response` does the same, so the browser reconnects about once a second. When the stream fails, `nav.js` shows a bar ("Server restarting… your page is kept"). When it opens again, the bar goes and the page refreshes once (`refreshLive`).