summaryrefslogtreecommitdiff
path: root/lib/timers
Commit message (Collapse)AuthorAgeFilesLines
* timers: reject with AbortError on cancellationBenjamin Gruenbaum2020-12-011-14/+4
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/36317 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
* timers: refactor to use more primordialsAntoine du Hamel2020-11-181-4/+7
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/36132 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* timers: cleanup abort listener on awaitable timersJames M Snell2020-11-091-16/+26
| | | | | | | | | | Co-authored-by: Benjamin Gruenbaum <benjamingr@gmail.com> Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36006 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* timers: use AbortController with correct name/messageAnna Henningsen2020-08-151-8/+12
| | | | | | | | | On the web, `AbortError` is the error name, not the error message. Change the code to match that. PR-URL: https://github.com/nodejs/node/pull/34763 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* timers: introduce timers/promisesJames M Snell2020-06-221-0/+124
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>