-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Resource is optional in napi_async_init
#33153
Labels
async_hooks
Issues and PRs related to the async hooks subsystem.
node-api
Issues and PRs related to the Node-API.
Comments
4 tasks
legendecas
added
node-api
Issues and PRs related to the Node-API.
async_hooks
Issues and PRs related to the async hooks subsystem.
labels
Apr 30, 2020
mhdawson
added a commit
to mhdawson/io.js
that referenced
this issue
Apr 30, 2020
Fixes: nodejs#33153 Change documentation to make async_resource required as opposed to optional in napi-async_init. Changes over time mean this parameter is required for proper operation of async hooks (which are still experimental). This changes the documentation to document what callers should do. We are doing this only in the doc in order to avoid a breaking change in N-API. We could create a new version of the method for which the parametrer is enforced as mandatory but we should only do that once async hooks is no longer experimental. In that case we could deprecate (but not remove this version of the method). Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com>
3 tasks
@legendecas, @Flarna this is what I'd suggest we do: I don't think we should change the implementation as it would be breaking which we can't do for N-API but updating the doc does make sense. |
I've left as draft until I get feedback from @legendecas and @Flarna that this makes sense to them as well. |
codebytere
pushed a commit
that referenced
this issue
May 7, 2020
Fixes: #33153 Change documentation to make async_resource required as opposed to optional in napi-async_init. Changes over time mean this parameter is required for proper operation of async hooks (which are still experimental). This changes the documentation to document what callers should do. We are doing this only in the doc in order to avoid a breaking change in N-API. We could create a new version of the method for which the parametrer is enforced as mandatory but we should only do that once async hooks is no longer experimental. In that case we could deprecate (but not remove this version of the method). Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com> PR-URL: #33181 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
codebytere
pushed a commit
that referenced
this issue
Jun 7, 2020
Fixes: #33153 Change documentation to make async_resource required as opposed to optional in napi-async_init. Changes over time mean this parameter is required for proper operation of async hooks (which are still experimental). This changes the documentation to document what callers should do. We are doing this only in the doc in order to avoid a breaking change in N-API. We could create a new version of the method for which the parametrer is enforced as mandatory but we should only do that once async hooks is no longer experimental. In that case we could deprecate (but not remove this version of the method). Signed-off-by: Michael Dawson <michael_dawson@ca.ibm.com> PR-URL: #33181 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
async_hooks
Issues and PRs related to the async hooks subsystem.
node-api
Issues and PRs related to the Node-API.
Maybe we should also think about adapting
napi_async_init
as it states that the resource is optional. As Node is meanwhile built to require an async resource it seems to be strange that we create an object on the fly if user doesn't provide one.Removing the null check in
napi_async_init
would be no issue from ABI point of view but breaking from behavior. Not sure if this should be included in this PR.Originally posted by @Flarna in #32930
The text was updated successfully, but these errors were encountered: