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].
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.
Re:Show HN: Live streaming SVG plot microservice that just w...
by jalfresi on Tuesday March 15, 2016 @02:22PM
(#11291830)
Really love the idea of embedding the EventSource and image update JavaScript in the SVG doc itself! Keeps the host page clean and tidy! Took me a while to get my head round where the python script was "generating" the svg.
A really clean solution, love it!
Re:Show HN: Live streaming SVG plot microservice that just w...
by ghubbard on Tuesday March 15, 2016 @11:50AM
(#11290507)
> I am very excited about pushing it to the limits!
Looks like you found them.
Re:Show HN: Live streaming SVG plot microservice that just w...
by grandrew on Tuesday March 15, 2016 @11:59AM
(#11290586)
I ran out of 1024 open file descriptors limit... May be a bug or 1024 connections... :-/ investigating
Re:Show HN: Live streaming SVG plot microservice that just w...
by chatmasta on Tuesday March 15, 2016 @12:15PM
(#11290730)
The classic scaling problem! Justin.tv faced the same one. [0]
> "a sign behind Emmett’s desk read “HAVE YOU CHECKED THE FILE DESCRIPTOR LIMITS?”
Side note... does anyone know why the default FD limit is so low at 1024 on most machines? It seems like there's very little cost to changing it to a high value (e.g. 65535).
Re:Show HN: Live streaming SVG plot microservice that just w...
by Isamu on Tuesday March 15, 2016 @12:38PM
(#11290923)
That is a classic. I would think the default is just an old vestige of mesozoic machine limitations. And its not like everybody is scaling up, most of the time it is indicative of a leak, and you would be happy to get the heads up.
Re:Show HN: Live streaming SVG plot microservice that just w...
by nemik on Tuesday March 15, 2016 @11:56AM
(#11290557)
This is very cool, thank you for making it!
I just have one concern: Does the AGPLv3 license mean I need to open-source whatever other service I make that might be making use of this?
Re:Show HN: Live streaming SVG plot microservice that just w...
by grandrew on Tuesday March 15, 2016 @12:12PM
(#11290695)
AGPLv3 means that if you use the _code_ provided at git repo, you should share whatever modifications you make; Using the service itself is no way affected.
But not having any "Terms of Service" is really a lack here, will be fixing that soon
In the world of HTML5, EventSource and all the modern infrastructure that shouldn't be so complicated!
So I crafted this microservice in a couple of days to solve this unfairness.
It generates an SVG image that does everything automatically, you just need to do some GET requests to feed your live data. It is in early stage testing, so be free to post what you think of the idea and the code, I will be happy to discuss!
p.s. my microservice is currently hosted at scaleway ARM microserver and I am very excited about pushing it to the limits!