{{ message }}
n-api: Context for custom async operations#15189
Closed
jasongin wants to merge 4 commits into
Closed
Conversation
This was referenced Sep 4, 2017
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. Fixes: nodejs#13254
219e699 to
53de2e1
Compare
Member
jasnell
reviewed
Sep 7, 2017
| operation (when there is no other script on the stack). It is a fairly simple | ||
| wrapper around `node::MakeCallback`. | ||
|
|
||
| Note it is NOT necessary to use `napi_make_callback` from within a |
Member
Author
|
As discussed for #15108, I need to change the string parameter of I also suggested a corresponding change to the string parameter of |
Member
Author
|
Update:
|
Member
Member
|
There seem to be some linter errors https://ci.nodejs.org/job/node-test-commit/12275/ |
Member
Author
|
I pushed a commit to fix the lint issues. |
Member
|
CI failure on ubuntu16 was a infra failure, not related to this PR. |
Member
|
Arm failure was also a infra failure, not related to this PR. |
Member
|
Looks like all of the breaking changes may be ready to go today (just watching #14697). Once it lands we'll land this and the other remaining breaking changes. |
Member
|
#14697 landed, going to land this one. |
Member
mhdawson
pushed a commit
that referenced
this pull request
Sep 14, 2017
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. PR-URL: #15189 Fixes: #13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
pushed a commit
to addaleax/ayo
that referenced
this pull request
Sep 17, 2017
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. PR-URL: nodejs/node#15189 Fixes: nodejs/node#13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
pushed a commit
that referenced
this pull request
Sep 20, 2017
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. PR-URL: #15189 Fixes: #13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Qard
pushed a commit
to Qard/ayo
that referenced
this pull request
Sep 21, 2017
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. PR-URL: nodejs/node#15189 Fixes: nodejs/node#13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
gabrielschulhof
pushed a commit
to gabrielschulhof/node
that referenced
this pull request
Apr 16, 2018
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. PR-URL: nodejs#15189 Fixes: nodejs#13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this pull request
Apr 16, 2018
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. Backport-PR-URL: #19447 PR-URL: #15189 Fixes: #13254 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

napi_async_contextopaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.)napi_async_init()andnapi_async_destroy()APIs.async_contextparameter tonapi_make_callback().test_make_callbackto validate async context APIs by checking async hooks are called with correct context.Fixes: #13254
See also the related PR #14697 in which
napi_create_async_work()is updated to automatically track async context. That PR together with this one make up the complete story for async context tracking with N-API.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
n-api