timers: runtime-deprecate {un}enroll()#18066
Conversation
doc/api/deprecations.md
Outdated
There was a problem hiding this comment.
Nit: Can we make this more concise? Maybe this?:
timers.enroll()is deprecated. Please use [setTimeout()][] or [setInterval()][] instead.
(Similarly for the other deprecation message below.)
lib/timers.js
Outdated
There was a problem hiding this comment.
Will this not emit the warning every time it is called vs just the first time? Any reason to not use util.deprecate() for this?
There was a problem hiding this comment.
Also, message should probably include () after the function name: timers.unenroll() is deprecated.
|
ping @Fishrock123 |
b36a973 to
6276c85
Compare
|
Updated, new CI: https://ci.nodejs.org/job/node-test-pull-request/12753/ |
|
what... how do I run the markdown linter? :| |
6276c85 to
6feb500
Compare
|
Ok, hope I fixed that. New CI: https://ci.nodejs.org/job/node-test-pull-request/12756/ |
6feb500 to
0c67ccd
Compare
This was never a Very Good API, and generally just left so many open ends for inconsistent behavior. The "optimization" benefit of this API is little to none. Makes a starting step towards removing it so that in the future timers, especially in their async_hooks interactions, can be simplified. PR-URL: nodejs#18066 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
0c67ccd to
68783ae
Compare
|
Thanks, landed in 68783ae |
This was never a Very Good API, and generally just left so many open ends for inconsistent behavior. The "optimization" benefit of this API is little to none. Makes a starting step towards removing it so that in the future timers, especially in their async_hooks interactions, can be simplified. PR-URL: nodejs#18066 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Another nail in the coffin here, farewell ye ol C-style apis. These apis caused numerous other issues that required far too many safeguards. This gets us one step closer to not having to worry about those issues anymore. Refs: nodejs#18066 Refs: nodejs#20298 PR-URL: nodejs#26760
Another nail in the coffin here, farewell ye ol C-style apis. These apis caused numerous other issues that required far too many safeguards. This gets us one step closer to not having to worry about those issues anymore. Refs: nodejs#18066 Refs: nodejs#20298 PR-URL: nodejs#26760 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Another nail in the coffin here, farewell ye ol C-style apis. These apis caused numerous other issues that required far too many safeguards. This gets us one step closer to not having to worry about those issues anymore. Refs: #18066 Refs: #20298 PR-URL: #26760 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Another nail in the coffin here, farewell ye ol C-style apis. These apis caused numerous other issues that required far too many safeguards. This gets us one step closer to not having to worry about those issues anymore. Refs: #18066 Refs: #20298 PR-URL: #26760 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This was never a Very Good API, and generally just left so many open ends for inconsistent behavior. The "optimization" benefit of this API is little to none. Makes a starting step towards removing it so that in the future, timers, especially in their async_hooks interactions, can be simplified.
For posterity:
enroll()&unenroll()have been exposed since 0.1.very-early, predatingsetTimeout()&clearTimeout()in Node. They have never been documented.@nodejs/tsc
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
timers