hntrl
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_...
https://en.wikipedia.org/wiki/Command%E2%80%93query_separati...
Websockets are a web standard, socket.io is a userland framework
To me the sticking point is what if the "response" message never comes? There's nothing in the websocket protocol that dictates that messages need to be acknowledged. With request/response the client knows how to handle that case natively
> And the websocket browser API is nicer to work with than, say, EventSource.
What in particular would you say?
(it's not SSE in particular, but it demonstrates that you can have a long running stream like SSE)
The SSE protocol is actually just a long-running stream like I mentioned but with specific formatting for each chunk (id, event, and data fields)
as a side note, eventkit actually exports utilities to support SSE both on client and server. The reason you'd want to use eventkit in either case is because it ships with some extra transformation and observability goodies. https://hntrl.github.io/eventkit/guide/examples/http-streami...
Show HN: Eventkit- a better way to work with data streams in JavaScript
https://github.com/hntrl/eventkit
Hey HN! I've spent the last few weeks working on eventkit, an open source library designed for working with data streams in TS/JS.I had a need to track all the work associated with handling application events. If you're familiar at all with reactive systems or what that entails, having this sort of functionality is super important.If you're familiar with observables or RxJS, this library is...