Fork me on GitHub
#core-async
<
2020-09-25
>
Zebra16:09:53

How to handle cpu intensive code in core.async? Thread or fixedthreadpool for io bound tasks and for cpu bound?

hiredman17:09:54

the thread macro can be used to spin both long running cpu bound stuff and io stuff

hiredman17:09:02

the main thing is just don't block the threadpool used for running go blocks, so if you have any code that could run for a long time without doing any channel operations (yielding the thread back to the threadpool) it is a good idea to give that a dedicated thread