5 ms·
Non-async functions are absolutely blocking. The question is if they’re expected to block for a meaningful amount of time, which is generally suggested by your
by trevyn 2y ago
Non-async functions are absolutely blocking. The question is if they’re expected to block for a meaningful amount of time, which is generally suggested by your async runtime.
It’s really not that bad, you might just need a better mental model of what’s actually happening.
- LtdJorge 2y agoDepends, on Linux you can call set_nonblocking on a TcpListener and get a WouldBlock error whenever a read would block. That's called non-blocking.
- jasdfuwjass 2y agoDoesn't this miss the forest for the trees? The entire point is to drive with epoll.
- LtdJorge 2y agoWell, yes. But it means you can do sync non-blocking IO by hand.