Skip to content

Commit 84a8969

Browse files
committed
reference other article
1 parent 6265289 commit 84a8969

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

apps/site/pages/en/learn/asynchronous-work/discover-promises-in-nodejs.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,4 @@ console.log('Synchronous task executed');
385385

386386
Because these tasks execute outside of the current synchronous flow, uncaught exceptions inside these callbacks won't be caught by surrounding `try/catch` blocks and may crash the application if not properly managed (e.g., by attaching `.catch()` to Promises or using global error handlers like `process.on('uncaughtException')`).
387387

388-
In short, the execution order is as follows:
389-
390-
1. **Synchronous code** (e.g., regular function calls and script code)
391-
2. **`process.nextTick()`** callbacks
392-
3. **Microtasks** (e.g., Promises, `queueMicrotask()`)
393-
If a microtask queues another microtask, the new one is also executed before moving on.
394-
4. **Timers** (e.g., `setTimeout()`, `setInterval()`)
395-
5. **I/O callbacks** (e.g., network and file system operations)
396-
Some operations, like `close` and `error` events, may use `process.nextTick()` internally and are executed in the next tick.
397-
6. **`setImmediate()`** callbacks
398-
399-
`process.nextTick()` can execute at any stage in the execution order, as it is not bound by the event loop.
400-
401-
Note that this order, and the `process.nextTick()` functionality, is specific to Node.js, and other runtimes may handle different events at different times.
388+
For more information on the Event Loop, and the execution order of various phases, please see the related article, [The Node.js Event Loop](/learn/asynchronous-work/event-loop-timers-and-nexttick).

0 commit comments

Comments
 (0)