3 ms·
With core.async (or go, for that matter), you can write code like: * do one thing * wait for the result of one thing (for example, an event from an interrupt)
by jwr 8y ago
With core.async (or go, for that matter), you can write code like:
* do one thing
* wait for the result of one thing (for example, an event from an interrupt)
* take the result and feed it into another thing
* wait for the result of another thing
So the code looks sequential. It's easy to write and easy to understand. But the entire 'go' block returns immediately: the whole thing gets converted into a state machine (which you don't normally see). That way you don't have to manage the complexity of the state machine yourself.
Note that this is not the same thing as threading. Also, it does not require threading at all, for example core.async works just as well in ClojureScript, even though Javascript has no threads.