Skip to content

Commit 88ed3d2

Browse files
lpincajasnell
authored andcommitted
doc: clarify sentence in event loop doc
Refs: #8370 (diff) PR-URL: #8400 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 137b7cb commit 88ed3d2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

β€Ždoc/topics/the-event-loop-timers-and-nexttick.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ order of operations.
3434
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ incoming: β”‚
3535
β”‚ β”‚ poll β”‚<────── connections, β”‚
3636
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ data, etc. β”‚
37-
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
37+
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3838
β”‚ β”‚ check β”‚
3939
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
4040
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
4141
└─── close callbacks β”‚
42-
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
42+
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
4343

4444
*note: each box will be referred to as a "phase" of the event loop.*
4545

@@ -69,11 +69,12 @@ actually uses - are those above._
6969

7070
* **timers**: this phase executes callbacks scheduled by `setTimeout()`
7171
and `setInterval()`.
72-
* **I/O callbacks**: most types of callback except timers, `setImmediate()`, close
73-
* **idle, prepare**: only used internally
74-
* **poll**: retrieve new I/O events; node will block here when appropriate
75-
* **check**: `setImmediate()` callbacks are invoked here
76-
* **close callbacks**: e.g socket.on('close', ...)
72+
* **I/O callbacks**: executes almost all callbacks with the exception of
73+
close callbacks, the ones scheduled by timers, and `setImmediate()`.
74+
* **idle, prepare**: only used internally.
75+
* **poll**: retrieve new I/O events; node will block here when appropriate.
76+
* **check**: `setImmediate()` callbacks are invoked here.
77+
* **close callbacks**: e.g. `socket.on('close', ...)`.
7778

7879
Between each run of the event loop, Node.js checks if it is waiting for
7980
any asynchronous I/O or timers and shuts down cleanly if there are not

0 commit comments

Comments
Β (0)