2 ms·
You can do non-blocking IO (and, of course, that's what's happening behind the scenes here, and in Erlang). The thing is, a program written with non-blocking IO
by toast0 6y ago
You can do non-blocking IO (and, of course, that's what's happening behind the scenes here, and in Erlang). The thing is, a program written with non-blocking IO has a lot different structure than with blocking IO.
It can feel clearer and easier to reason about what happens on a single connection if the code is like:
accept, read, process, write and somewhere else handles the concurrency
Especially if the one system does a lot of different things, but they're all related enough to be in one OS process, mashing together a lot of isolated non-blocking IO can be pretty tricky, and hard to keep track of.