4 ms·
This is my latest weekend project[1] and first web application written in Go. Go's concurrency model made it very easy to query multiple sites at once and strea
by conroy 14y ago
This is my latest weekend project[1] and first web application written in Go. Go's concurrency model made it very easy to query multiple sites at once and stream the data back to the client. Specifically, I'm creating a Gorountine for each website, sending results to a channel, and then streaming those results back using server-sent events[2]. Server-sent events aren't supported by all browsers, so I'm using Yaffle's EventSource polyfill[3](https://github.com/Yaffle/EventSource https://github.com/Yaffle/EventSource).
[1]: https://github.com/kyleconroy/handlehelp https://github.com/kyleconroy/handlehelp
[2]: https://developer.mozilla.org/en-US/docs/Server-sent_events/EventSource#close%28%29 https://developer.mozilla.org/en-US/docs/Server-sent_events/...
[3]: https://github.com/Yaffle/EventSource https://github.com/Yaffle/EventSource