Skip to content

Commit

Permalink
doc: clarify sentence in event loop doc
Browse files Browse the repository at this point in the history
Refs: #8370 (diff)
PR-URL: #8400
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
lpinca authored and Fishrock123 committed Sep 14, 2016
1 parent f346dee commit c7771e6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions doc/topics/the-event-loop-timers-and-nexttick.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ order of operations.
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ incoming: β”‚
β”‚ β”‚ poll β”‚<────── connections, β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ data, etc. β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚ check β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
└─── close callbacks β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

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

Expand Down Expand Up @@ -69,11 +69,12 @@ actually uses - are those above._

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

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

0 comments on commit c7771e6

Please sign in to comment.