Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions pages/asynchronous-work/event-loop-timers-and-nexttick.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,36 @@ this document) which may make async API calls, schedule timers, or call
The following diagram shows a simplified overview of the event loop's
order of operations.

<!--
NOTE: This diagram may appear misaligned in the markdown source,
but it renders correctly in the HTML view on the live page.
Future contributors: please do not adjust the alignment here
unless it is also broken on a live page.
-->

```
┌───────────────────────────┐
timers
│ timers │
└─────────────┬─────────────┘
v
v
┌───────────────────────────┐
┌─>│ pending callbacks
┌─>│ pending callbacks │
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ idle, prepare
│ └─────────────┬─────────────┘ ┌───────────────┐
│ │ idle, prepare │
│ └─────────────┬─────────────┘ ┌───────────────
│ ┌─────────────┴─────────────┐ │ incoming: │
│ │ poll │<─────┤ connections, │
│ │ poll │<─────┤ connections, │
│ └─────────────┬─────────────┘ │ data, etc. │
│ ┌─────────────┴─────────────┐ └───────────────┘
│ │ check
│ ┌─────────────┴─────────────┐ └───────────────
│ │ check │
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
│ │ close callbacks
│ │ close callbacks │
│ └─────────────┬─────────────┘
│ ┌─────────────┴─────────────┐
└──┤ timers
└──┤ timers │
└───────────────────────────┘
```

Expand Down
Loading