-
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
async_hooks: C++ Embedder API overhaul #14040
Closed
AndreasMadsen
wants to merge
9
commits into
nodejs:master
from
AndreasMadsen:fix-async-hooks-cpp-embedding
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4af3a33
async_hooks: C++ Embedder API overhaul
AndreasMadsen df876b8
[squash] use context struct and fix AsyncResources
AndreasMadsen 1a6e24d
[squash] rename async_uid to async_id
AndreasMadsen c7c441e
[squash] minor cleanup
AndreasMadsen 89e7ccd
[squash] cleanup struct def
AndreasMadsen e78d988
[squash] fix lint issue
AndreasMadsen 9aa3ba2
[squash] make async_context properties public
AndreasMadsen 98b5e9b
[squash] rename get_uid to get_async_id
AndreasMadsen 48ef6a2
[squash] add AsyncResource::get_trigger_async_id
AndreasMadsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems to me like this breakage would be shim-able… If that’s right, I’d say we label this dont-land and I can do a non-breaking backport to v8.x, if you like
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.
That would be awesome. In particular, I couldn't see how to make
EmitAsyncInit
backward compatible.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.
The old API required
trigger_async_id
instead of leaving it optional, so we could make it return a pair based on that parameter, right?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.
What should
EmitAsyncInit
then return whentrigger_async_id
is specified?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.
I don’t really understand the question, sorry. Basically, what we need to shim is the old definition
in terms of the new one in this PR, right?
So what’s speaking against
OldStyleEmitAsyncInit(resource, name, trigger_async_id) := (NewStyleAsyncInit(resource, name, trigger_async_id)).async_id_
?Or are you thinking about the return type? The hacky solution would be to enable casting from
async_context
toasync_id
by returningasync_id_
(and immediately deprecating that), it’s not pretty but as long as it doesn’t end up in master I’m okay with that.(One more thing: I’m noticing, maybe we should not underscore-suffix the fields of
async_context
given that they are public, not internal…)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.
Yes, it is the return type. The casting makes sense.
Right. Please check ffdd431d7d42efe939f3cc378814844b5796e4b5.