Fork me on GitHub
#code-reviews
<
2021-03-17
>
Sam Ferrell00:03:24

Any thoughts on this bit of core.async code to fetch a bunch of web pages concurrently and wait until they're all finished to return? https://gist.github.com/samcf/427fc7cde338402ffc5c040bf8d692e7

jjttjj00:03:06

Looks nice to me

noisesmith01:03:43

putting IO (like http requests here) inside go is a bad idea, better to use async/thread then use <! on the chan it returns from another go block

👍 6
noisesmith01:03:08

the number of go threads are limited and not meant for long running tasks like IO

noisesmith01:03:31

here core.async isn't doing anything for you - this would be simpler code, and more efficient to boot, using futures or claypoole

Sam Ferrell04:03:02

thanks, that makes sense, i'll try that out 👍