Hacker News new | ask | show | jobs
by trevyn 596 days 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.

1 comments

Depends, 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.
Doesn't this miss the forest for the trees? The entire point is to drive with epoll.
Well, yes. But it means you can do sync non-blocking IO by hand.