Replies: 1 comment
-
@dSalieri Hey there! Sadly, no, you can't create idle and prepare callbacks directly via JavaScript in Node.js. So, here's the deal: Node.js documentation and many articles say:
What does this mean? This means that as a developer using Node.js, you won't have direct access to these stages ( 1 - What do these operations actually do? Their role is somewhat similar to 2 - If you remove uv__run_idle(loop) and uv__run_prepare(loop) from the Node.js codebase, will something break or what will this affect? If you yank these functions out of the Node.js codebase, it could mess with the internal workings of the event loop. These handles make sure the event loop runs efficiently, managing idle times and getting ready for I/O operations. Without them, the event loop might not perform as well, and you could see issues with how asynchronous tasks are handled. In a nutshell, while you can't create or manipulate |
Beta Was this translation helpful? Give feedback.
-
I've read a lot of articles online and also read the node.js documentation and also read an overview of the libuv.
What says libuv:
Can idle callbacks and prepare callbacks be created via javascript on node.js platform? If not, then why are they and what do they affect?
What node.js doc and lot of articles say:
And what does it mean? That is, on the node.js platform we cannot reach these pointed stages in any way?
Then there are two questions:
uv__run_check(loop)
and this stage is somewhere tied tosetImmediate
processing but I don’t know where).uv__run_idle(loop)
anduv__run_prepare(loop)
from the node.js codebase, will something break or what will this affect?I still haven't seen answers to these questions, which is very strange because the (idle, prepare) phase in the node.js documentation is quoted from every corner, but no one knows what this phase does, which is sad.
P.S. I looked at the source code in libuv, but it didn’t give me anything, because you have to know the structure of node.js and its components.
Beta Was this translation helpful? Give feedback.
All reactions