GeezerVison is showing github.com — doc: remove "idiomatic choice" from queueMicrotask · nodejs/node@ee299c7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/globals.md +4-3Lines changed: 4 additions & 3 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,9 +122,10 @@ The `queueMicrotask()` method queues a microtask to invoke `callback`. If |
122 | 122 | `callback` throws an exception, the [`process` object][] `'uncaughtException'` |
123 | 123 | event will be emitted. |
124 | 124 |
|
125 | | -In general, `queueMicrotask` is the idiomatic choice over `process.nextTick()`. |
126 | | -`process.nextTick()` will always run before the microtask queue, and so |
127 | | -unexpected execution order may be observed. |
| 125 | +The microtask queue is managed by V8 and may be used in a similar manner to |
| 126 | +the `process.nextTick()` queue, which is managed by Node.js. The |
| 127 | +`process.nextTick()` queue is always processed before the microtask queue |
| 128 | +within each turn of the Node.js event loop. |
128 | 129 |
|
129 | 130 | ```js |
130 | 131 | // Here, `queueMicrotask()` is used to ensure the 'load' event is always |
|