Skip to content

Commit ee299c7

Browse files
rvaggtargos
authored andcommitted
doc: remove "idiomatic choice" from queueMicrotask
It can't be idiomatic if it's not in general use and therefore hasn't been picked up by users. It's not even in browsers yet. "Idiomatic" use is an emergent property that comes from observed use and this feature is so new (to browsers and Node) that it can't possibly be. In general I don't think it's the place of the Node API docs to observe what emerges as idiomatic Node.js. It also can't be a recommended feature (if that was the intent of the language) because it's marked experimental. For now, it's just a feature, nothing more. Recommendations and/or observations about it being 'idiomatic' can come later. PR-URL: #23885 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 147e5d5 commit ee299c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/globals.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ The `queueMicrotask()` method queues a microtask to invoke `callback`. If
122122
`callback` throws an exception, the [`process` object][] `'uncaughtException'`
123123
event will be emitted.
124124

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.
128129

129130
```js
130131
// Here, `queueMicrotask()` is used to ensure the 'load' event is always

0 commit comments

Comments
 (0)