3 ms·
My issue is definitely not familiarity. I've written more async code in more languages than most (node, java, ruby, clojure). My main takeaway is, unless I abs
by andrewvc 14y ago
My issue is definitely not familiarity. I've written more async code in more languages than most (node, java, ruby, clojure).
My main takeaway is, unless I absolutely have to use async code I won't. It's almost never cleaner than queuing onto a thread-pool.
In the case of highly parallel IO, yes, a thousand times yes async is great. But the great lie about node is that people need to carry over the async from the IO layer to the app logic layer. In node it's all just mashed together.
For instance, the problem a websocket server is trying to solve is multiplexing M connections onto N available cores. Async works great for the connections layer, and a thread-pool well for the logic layer.
The trick about async is that your server can handle 10,000 connections that are idle, but only a handful active at a given time since you only have a few cores. Thread scheduling works just fine.
None of these ideas are novel, in fact, they are decades old. The real problem is the faddishness of ideas.