-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
async_hooks: deprecate the AsyncResource.bind asyncResource property #46432
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
async_hooks: deprecate the AsyncResource.bind asyncResource property #46432
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Runtime-deprecates the `asyncResource` property that is attached to the wrapper function returned by `asyncResource.bind()`. This property is not expected to align with the equivalent `asyncContext.wrap()` API in the proposed TC39 standard.
1e1cfc8 to
4588666
Compare
|
/cc @nodejs/tsc |
mcollina
left a comment
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.
lgtm
Commit Queue failed- Loading data for nodejs/node/pull/46432 ✔ Done loading data for nodejs/node/pull/46432 ----------------------------------- PR info ------------------------------------ Title async_hooks: deprecate the AsyncResource.bind asyncResource property (#46432) Author James M Snell (@jasnell) Branch jasnell:deprecate-asyncresource-property -> nodejs:main Labels semver-major, async_hooks, author ready Commits 1 - async_hooks: deprecate the AsyncResource.bind asyncResource property Committers 1 - James M Snell PR-URL: https://github.com/nodejs/node/pull/46432 Reviewed-By: Chengzhong Wu Reviewed-By: Stephen Belanger Reviewed-By: Gerhard Stöbich Reviewed-By: Michaël Zasso Reviewed-By: Matteo Collina ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/46432 Reviewed-By: Chengzhong Wu Reviewed-By: Stephen Belanger Reviewed-By: Gerhard Stöbich Reviewed-By: Michaël Zasso Reviewed-By: Matteo Collina -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 30 Jan 2023 23:25:04 GMT ✔ Approvals: 5 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/46432#pullrequestreview-1276302922 ✔ - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/46432#pullrequestreview-1276606639 ✔ - Gerhard Stöbich (@Flarna): https://github.com/nodejs/node/pull/46432#pullrequestreview-1276659985 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/46432#pullrequestreview-1279316281 ✔ - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/46432#pullrequestreview-1279318704 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-01-31T07:28:43Z: https://ci.nodejs.org/job/node-test-pull-request/49273/ ⚠ Commits were pushed after the last Full PR CI run: ⚠ - async_hooks: deprecate the AsyncResource.bind asyncResource property - Querying data for job/node-test-pull-request/49273/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/4079305303 |
This comment was marked as outdated.
This comment was marked as outdated.
|
Landed in 9fafb0a |
|
@jasnell I had opened #43065, and it was approved, but didn't land it due to some internal discussion on whether there was a better approach. While that discussion proceeded (over .. what's now many months, sorry!), it looks like this one landed. The addition of the deprecation warnings precludes the ability to use the faster ordinary object assignment in #43065. I see two paths forward:
I'm leaning toward option 2, since it's trivial to construct a userland implementation of |
Runtime-deprecates the
asyncResourceproperty that is attached to the wrapper function returned byasyncResource.bind(). This property is not expected to align with the equivalentasyncContext.wrap()API in the proposed TC39 standard./cc @nodejs/async_hooks