diff options
author | James M Snell <jasnell@gmail.com> | 2020-06-18 13:22:17 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-06-22 14:29:49 -0700 |
commit | a8904e8eeea3ca513de588424bb99f6a7cdfc598 (patch) | |
tree | 35d9fc741714a1c71939b91c9b8ef69cdbf65f4c /node.gyp | |
parent | bfc0e3f0b0bc99deffe99586bd9f03a27c6ed098 (diff) | |
download | node-new-a8904e8eeea3ca513de588424bb99f6a7cdfc598.tar.gz |
timers: introduce timers/promises
Move the promisified timers implementations into a new sub-module
to avoid the need to promisify. The promisified versions now return
the timers/promises versions.
Also adds `ref` option to the promisified versions
```js
const {
setTimeout,
setImmediate
} = require('timers/promises');
setTimeout(10, null, { ref: false })
.then(console.log);
setImmediate(null, { ref: false })
.then(console.log);
```
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/33950
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'node.gyp')
-rw-r--r-- | node.gyp | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -85,6 +85,7 @@ 'lib/_stream_wrap.js', 'lib/string_decoder.js', 'lib/sys.js', + 'lib/timers/promises.js', 'lib/timers.js', 'lib/tls.js', 'lib/_tls_common.js', |