-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timers: deprecate active() and _unrefActive() #26760
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2368,6 +2368,38 @@ Type: Runtime | |
|
||
The `_stream_wrap` module is deprecated. | ||
|
||
<a id="DEP0126"></a> | ||
### DEP0126: timers.active() | ||
<!-- YAML | ||
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/26760 | ||
description: Runtime deprecation. | ||
--> | ||
|
||
Type: Runtime | ||
|
||
The previously undocumented `timers.active()` is deprecated. | ||
Please use the publicly documented [`timeout.refresh()`][] instead. | ||
If re-referencing the timeout is necessary, [`timeout.ref()`][] can be used | ||
with no performance impact since Node.js 10. | ||
|
||
<a id="DEP0127"></a> | ||
### DEP0127: timers._unrefActive() | ||
<!-- YAML | ||
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/26760 | ||
description: Runtime deprecation. | ||
--> | ||
|
||
Type: Runtime | ||
|
||
The previously undocumented and "private" `timers._unrefActive()` is deprecated. | ||
Please use the publicly documented [`timeout.refresh()`][] instead. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's an awkward combination of both. It is essentially "refresh this timer as unrefed". Active is the same, but refed. Perhaps there was an extra meaning back when |
||
If unreferencing the timeout is necessary, [`timeout.unref()`][] can be used | ||
with no performance impact since Node.js 10. | ||
|
||
[`--pending-deprecation`]: cli.html#cli_pending_deprecation | ||
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size | ||
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array | ||
|
@@ -2423,6 +2455,9 @@ The `_stream_wrap` module is deprecated. | |
[`script.createCachedData()`]: vm.html#vm_script_createcacheddata | ||
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args | ||
[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args | ||
[`timeout.ref()`]: timers.html#timers_timeout_ref | ||
[`timeout.refresh()`]: timers.html#timers_timeout_refresh | ||
[`timeout.unref()`]: timers.html#timers_timeout_unref | ||
[`tls.CryptoStream`]: tls.html#tls_class_cryptostream | ||
[`tls.SecureContext`]: tls.html#tls_tls_createsecurecontext_options | ||
[`tls.SecurePair`]: tls.html#tls_class_securepair | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
DEP0XXX
till landing (here, below and in the next section)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really matter? ¯\_(ツ)_/¯
So long as it's updated if necessary at landing...