This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-01
Channels
- # announcements (1)
- # aws (3)
- # beginners (150)
- # boot (12)
- # calva (7)
- # carry (3)
- # cider (1)
- # clara (51)
- # cljdoc (17)
- # cljs-dev (17)
- # cljsrn (1)
- # clojure (64)
- # clojure-austin (2)
- # clojure-india (1)
- # clojure-italy (10)
- # clojure-nl (4)
- # clojure-spec (42)
- # clojure-uk (63)
- # clojurescript (24)
- # core-async (23)
- # cursive (6)
- # datascript (7)
- # datomic (5)
- # figwheel-main (43)
- # fulcro (74)
- # hoplon (7)
- # kaocha (30)
- # leiningen (32)
- # mount (51)
- # nrepl (34)
- # off-topic (29)
- # re-frame (6)
- # reagent (10)
- # reitit (13)
- # shadow-cljs (66)
- # slack-help (3)
- # spacemacs (2)
- # specter (5)
- # sql (2)
- # tools-deps (51)
- # yada (13)
one concern is robustness in the face of intermittent connectivity on mobile clients, SSE seems to be simpler/more robust here from what I can find out but I’ll probably need to test both
@oliver.mooney both ws and sse hold a tcp socket - i shouldn't think there is much between them in terms of fundamental robustness. one thing that might be better from this perspective with ws is that it's a bi-directional channel, so you can send ping/pongs up and down the socket, so both ends can confirm liveness without waiting for any tcp layer timeouts
@mccraigmccraig I was thinking I’d need to use some keep-alive ping/pongs alright. I was going to do the same with SSE by sending per-client empty msgs at set intervals, but it seems at some point both devolve into polling
@mccraigmccraig SSE has automatic reconnect built-in at the browser level.
https://stackoverflow.com/a/5326159 seems to be a good wiki 🙂
These guys seemed to have issues with disconnection detection with SSEs https://streamdata.io/blog/push-sse-vs-websockets/
that's pretty nice @dominicm - but how long do you have to wait for auto-reconnection to kick in though ? we came to the conclusion with our websockets that we wanted application control over latency/liveness and that tcp timeouts weren't doing what we needed
https://www.html5rocks.com/en/tutorials/eventsource/basics/ looks like it's 3s by default, and you can alter it via a message from the server.
but how long before it recognizes that a connection is "dead" - e.g. when you wonder into an area of GPRS connectivity your connection might still be technically alive, but packet latency can go up to many seconds or even 10s of seconds - we would consider such a connection dead and report to the user that they are disconnected
as i understand it, SSE doesn't give the client any way of sending further info to the server after the initial connection, so unless there's a way of specifying "consider the connection dead unless i get some traffic on it at least every N seconds" you might be waiting a while for a tcp timeout on a mobile network