News for hackers. Stuff that matters.
Re:Show HN: Live streaming SVG plot microservice that just w... by untog on Tuesday March 15, 2016 @11:58AM (#11290570)
I do web dev for a living and I'm slightly embarrassed that this is the first time I've heard of the EventSource API. Why would I use it over Websockets, though? It appears that it does the same thing - keeps an HTTP connection open - but without the ability for the client to send anything back.
Re:Show HN: Live streaming SVG plot microservice that just w... by TN1ck on Tuesday March 15, 2016 @12:18PM (#11290755)
I wouldn't, EventSource isn't supported by IE yet[0].

[0] http://caniuse.com/#search=EventSource

Re:Show HN: Live streaming SVG plot microservice that just w... by adrianpike on Tuesday March 15, 2016 @12:44PM (#11290971)
I've been using this polyfill for years in production with success: https://github.com/Yaffle/EventSource
Re:Show HN: Live streaming SVG plot microservice that just w... by drhayes9 on Tuesday March 15, 2016 @12:16PM (#11290745)
My favorite thing about EventSource/ServerSentEvents is that reconnection is handled for you by the browser. EventSource also works over straight HTTP without need to renegotiate the protocol, which is nice for hosts that don't support WebSockets.
Re:Show HN: Live streaming SVG plot microservice that just w... by dclowd9901 on Tuesday March 15, 2016 @12:42PM (#11290951)
I can think of many scenarios where the client needn't send anything back, notifications being an immediate example; I haven't dabbled with either, but I imagine reasoning about EventSource is probably a little bit easier than WebSockets.
Re:Show HN: Live streaming SVG plot microservice that just w... by PeCaN on Tuesday March 15, 2016 @01:46PM (#11291512)
I used it for notifications once and it was really nice, as well as trivial to implement on the server side. I think that it can be thrown in to basically any server is a big selling point.
Re:Show HN: Live streaming SVG plot microservice that just w... by grandrew on Tuesday March 15, 2016 @12:02PM (#11290614)
In this particular case this is exactly what I need - to send server generated events with no way to talk back :) I just use the right tool for the right thing here
Re:Show HN: Live streaming SVG plot microservice that just w... by wiml on Tuesday March 15, 2016 @08:50PM (#11294183)
It handles a lot of the details if what you want is to get a stream of asynchronous events. You can certainly implement an equivalent on top of websockets, but the same is true of any protocol, including HTTP itself.