4 ms·
I think the reason channels become harder to understand is that you jump to having a network topology of senders and receivers to reason about. With async/awai
by emadda 2y ago
I think the reason channels become harder to understand is that you jump to having a network topology of senders and receivers to reason about.
With async/await, everything is still a function. Your IDE and debugger help you understand when and where a function is called. When debug-breaking on a function you have the stack trace.
Async/await gets you fast context switching for IO ops as it is a single OS process (no threads for the OS to constantly switch).
But once you go beyond a single OS process, then you need something like messaging or shared memory on top of async/await to communicate between OS processes/threads.
I think Golang jumps straight to messaging which is better for multiple cores, but misses the first step of async/await which is easier to reason about when you have a single process on a single core.