V
V
Vasya Lee2019-11-16 22:58:11
Node.js
Vasya Lee, 2019-11-16 22:58:11

What gets into the phase of I/O callbacks in node?

We are talking about the event loop in node js. I'm trying to figure it out, I found two normal screencasts and several articles, everything seems to be more or less clear. The only thing that is very confusing is that everyone writes about the phase (second phase) of i / o callbacks is different. What in articles, what in screencasts, when the authors begin to analyze a real example, they begin to contradict themselves. The result is a lot of confusion. One says the networking phase, the second says that all user code, the third that all input and output, etc...
Please tell me what exactly gets into I / O callbacks (preferably with examples of functions)
And what gets into the Poll phase. Everyone writes about this phase inconsistently.
I would be grateful if you advise literature, preferably in Russian. I'm bad with English.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Inviz Custos, 2019-11-17
@ahmapiz

The pending callbacks phase is almost all callbacks, except for close events , timers , and setImmediate() The poll
phase is the most interesting and complex phase, preparation for which begins in the previous phase, and the status of other queues is also checked. In short, here we work with "external sources" (incoming connections are accepted, etc), work with a multithread (thread pool), work with file descriptors, ect. The libuv library is constantly evolving, the behavior of some of its parts may change from version to version. Therefore, you can get the most up-to-date information only by reading the source code .
.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question