This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-24
Channels
- # aleph (1)
- # babashka (2)
- # beginners (25)
- # calva (5)
- # cider (8)
- # cljdoc (4)
- # clojure (81)
- # clojure-europe (41)
- # clojure-spec (11)
- # clojurescript (7)
- # conjure (1)
- # data-science (1)
- # datomic (25)
- # defnpodcast (3)
- # events (2)
- # figwheel-main (8)
- # fulcro (5)
- # helix (4)
- # hugsql (1)
- # java (2)
- # off-topic (35)
- # onyx (18)
- # pathom (8)
- # rdf (5)
- # re-frame (9)
- # reagent (3)
- # reitit (1)
- # shadow-cljs (39)
- # tools-deps (53)
- # xtdb (23)
I'm not really clear on how a web sites gets access to TCP transportation, but I'm assuming it's via some kind of sandbox that the browser contains.
I'm trying to decide if streaming to the browser is even a good idea, or if I should stick to polling things.
I have this application that renders a 3d environment and the entities' position within this environment is constantly updating.
So say I have for example 3000 entities moving around and they each have an x, y, z coordinate and a few bytes of metadata on them.
Web sockets should have a lower overhead as doing http polling will have overhead of headers, cookies etc.
Because I won't be able to access TCP keepalive or similar things inside the browser right?
Yes you need your own retry logic, and keep alive. Honestly I’d use a library that handles those for me.
Yeah I'm looking at something like that. We've tried grpc-web but the streaming logic was leaking all over the place and you barely need it for the backend where you can use HTTP2.
An alternative worth considering is using SSE which is push only (not bidirectional) and handles retry and keep alive. But it’s a more obscure tech, albeit simpler.
Yeah I've actually looked into that quite a bit and even built a grpc http2 stream -> sse http1.1 proxy thingamajig, but the handing of retries and such was a bit off
I still needed in-band keepalives to make sure the browser really understood if it had lost the connection in all cases.
Yeah then websockets is probably the browser tech to use. You can have your own ACK logic etc.
It would be interesting / terrifying to understand the differences between browsers and socket handling as well but I am frankly disgusted by the prospect of learning that stuff and then having the Chrome team pull my rug out from under me 😄
Sorry it was a bit out of context there - it's an argument against streaming grpc between backend services since due to their HTTP2 nature the request response is pretty efficent anyway
The only downside about websockets that I’ve seen in the wild is some corporate frameworks silently blocking them.
So libraries like http://socket.IO or sente give you an API that will fall back to long polling.
The gentlemen building the frontend in question have chosen angular to build their application (yes I'm interested in another job...) so I'll have a look at what they can use from there easily 😃
http://Socket.IO is the leading js framework i think.