Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does blocking I/O or not is very much a property of the function itself, as is "may finish up running on a different thread from the one it started on" (or, if you prefer, "needs to be run under a runtime that provides that capability").

Sending a letter and getting a reply is an inherently async action; you can stare at the mailbox all day but you probably don't want to. Waiting in line at the bank is inherently sync; if you try to do something else and then come back they'll make you start over again.



> you can stare at the mailbox all day but you probably don't want to

Yet, it's up to me to decide, not to the mailbox.


You can always call blocking await on an async function. It's just usually a bad idea.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: