mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
c1234673bb
Refactor Immediates handling to allow for them to be unrefed, similar to setTimeout, but without extra handles. Document the new `immediate.ref()` and `immediate.unref()` methods. Add SetImmediateUnref on the C++ side. PR-URL: https://github.com/nodejs/node/pull/18139 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
8 lines
204 B
JavaScript
8 lines
204 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
// This immediate should not execute as it was unrefed
|
|
// and nothing else is keeping the event loop alive
|
|
setImmediate(common.mustNotCall()).unref();
|