3 ms·
This is true, but I think it's worth mentioning that core.async lets you freely mix "full threads" with work scheduled from a thread pool. You use the same chan
by jwr 8y ago
This is true, but I think it's worth mentioning that core.async lets you freely mix "full threads" with work scheduled from a thread pool. You use the same channels for both. You do the lightweight stuff in go blocks, and the I/O heavy work in a `(thread)`, where you use `<!!` and `>!!` for blocking gets and puts, respectively.
I find this to be amazingly flexible. You are right in saying that it's a gotcha: you do not want to do I/O heavy work in go blocks in general.
It is also worth noting that core.async works just as well in ClojureScript, which when you thing of it is pretty amazing. No threads there, of course.