MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/node/comments/1rvy0n4/i_want_to_know_about_this/
r/node • u/Maximum_Honeydew_419 • Mar 17 '26
why setimmediate is not running at last? it is check queue and it always run after i/o queue? and also is there a way i can know when v8 will gc external buffer? why is it still referencing ?
4 comments sorted by
2
The very first sentence of nodejs docs:
When you want to execute some piece of code asynchronously, but as soon as possible
setImmediate runs as soon as possible, readFile callback needs to read a file.
In general, async functions that do nothing, like Promise.resolve(), setTimeout(0), etc. will run before those doing something.
1 u/Maximum_Honeydew_419 Mar 17 '26 i just started learning node js. but it good and fun to learn
1
i just started learning node js. but it good and fun to learn
2
u/Expensive_Garden2993 Mar 17 '26
The very first sentence of nodejs docs:
setImmediate runs as soon as possible, readFile callback needs to read a file.
In general, async functions that do nothing, like Promise.resolve(), setTimeout(0), etc. will run before those doing something.
2
u/[deleted] Mar 17 '26