From ee299c7ef12435161de36b7fa3185f6baf6f29c0 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Fri, 26 Oct 2018 09:52:12 +1100 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/23885 Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Colin Ihrig Reviewed-By: Yuta Hiroto Reviewed-By: Matheus Marchini Reviewed-By: Vse Mozhet Byt Reviewed-By: Trivikram Kamat --- doc/api/globals.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/globals.md b/doc/api/globals.md index e41d621883184b..22699f035e53b0 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -122,9 +122,10 @@ The `queueMicrotask()` method queues a microtask to invoke `callback`. If `callback` throws an exception, the [`process` object][] `'uncaughtException'` event will be emitted. -In general, `queueMicrotask` is the idiomatic choice over `process.nextTick()`. -`process.nextTick()` will always run before the microtask queue, and so -unexpected execution order may be observed. +The microtask queue is managed by V8 and may be used in a similar manner to +the `process.nextTick()` queue, which is managed by Node.js. The +`process.nextTick()` queue is always processed before the microtask queue +within each turn of the Node.js event loop. ```js // Here, `queueMicrotask()` is used to ensure the 'load' event is always