diff --git a/doc/api/vm.md b/doc/api/vm.md index 14cd1f269b1..4152a302411 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -1318,6 +1318,31 @@ added: A `ModuleRequest` represents the request to import a module with given import attributes and phase. +## Class: `vm.MicrotaskQueue` + + + +Represents an explicit microtask queue that can be shared across multiple +`vm.Context` instances and synchronously drained by the embedder. + +### `new vm.MicrotaskQueue()` + + + +Creates a new `vm.MicrotaskQueue` instance. + +### `microtaskQueue.runMicrotasks()` + + + +Synchronously runs all microtasks currently queued in this microtask queue. + ## `vm.compileFunction(code[, params[, options]])` + +* Returns: {vm.MicrotaskQueue} + +Creates a new [`vm.MicrotaskQueue`][] instance. Shortcut to +`new vm.MicrotaskQueue()`. + +## `vm.isMicrotaskQueue(object)` + + + +* `object` {any} +* Returns: {boolean} + +Returns `true` if the given `object` is an instance of [`vm.MicrotaskQueue`][]. + ## `vm.measureMemory([options])`