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

No, that's not the case. twait won't block your Node process from handling other events.


Isn't it waiting to execute anything that follows after a twait code block?

If so, then it is blocking. Otherwise, how do you manage to let other code be executed, except the code you don't want to be executed until all functions in the twait block have returned?

The would need to be a callback attached to the twait block, but there isn't. So it's blocking.

Because that is it's purpose, to block further executing until all data from the non-blocking functions have returned.


From looking at it, each twait block is blocking as a unit, but other code elsewhere from the twait block will still run.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: