3 ms·
> At high levels of concurrency (thousands of connections) your server needs to go to asynchronous non-blocking. It does. But it doesn't have to expose that as
by rdtsc 13y ago
> At high levels of concurrency (thousands of connections) your server needs to go to asynchronous non-blocking.
It does. But it doesn't have to expose that as callback chains or promises to the whole over-arching infrastructure that sits on top. Concurrency units should be isolated from each other and internally execute whatever their logic is without having to worry about being polluted with callbacks. Then there could be multiple of such concurrency units executing in parallel but that is a the job of a decent VM/runtime/library to handle.
> And at these levels of concurrency, you can’t go creating threads for every connection.
Even something as simple as python gevent can create tens of thousands of green threads without a problem without exposing callback chains for everyone to see.
Erlang VM and something like https://github.com/puniverse/quasar https://github.com/puniverse/quasar can run with millions of concurrency units so do goroutines and Rust's concurrency units (sorry forgot the name).
> So the whole codepath needs to be non-blocking and async, not just the IO layer.
Quite the opposite. If your whole codepath riddled with callback chains and your project is large now you have a huge headache to deal with.
> This is where Node excels.
If it forces one to use promises/deferreds/futures or nested callbacks, I say it fails.