-
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
AsyncWrap minor fixes #1614
AsyncWrap minor fixes #1614
Conversation
72d62fb
to
d7e0c53
Compare
Some calls to ReqWrap would get through the initial check and allow the init callback to run, even though the callback had not been used on the parent. Fix by explicitly checking if the parent has a queue. Also change the name of the check, and internal field of AsyncHooks. Other names were confusing.
d7e0c53
to
13e52fe
Compare
LGTM with a suggestion. |
Allow the init callback to see the PROVIDER type easily by being able to compare the flag with the list of providers on the exported async_wrap object.
Setting flags using cryptic numeric object fields is confusing. Instead use much simpler .enable()/.disable() calls on the async_wrap object.
It doesn't make sense to call before/after callbacks in init to the parent because they'll be made anyway from MakeCallback. If information does need to be propagated then it should be done automatically. Will deal with this if the issue arrises in the future.
13e52fe
to
eed38b3
Compare
@bnoordhuis thanks. addressed both comments. |
@@ -62,6 +58,8 @@ static void Initialize(Handle<Object> target, | |||
HandleScope scope(isolate); | |||
|
|||
NODE_SET_METHOD(target, "setupHooks", SetupHooks); |
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 would do the same for SetupHooks for consistency. That can wait for another PR though.
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.
might as well. had to run before I had a chance to land this.
LGTM |
Some calls to ReqWrap would get through the initial check and allow the init callback to run, even though the callback had not been used on the parent. Fix by explicitly checking if the parent has a queue. Also change the name of the check, and internal field of AsyncHooks. Other names were confusing. PR-URL: #1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Allow the init callback to see the PROVIDER type easily by being able to compare the flag with the list of providers on the exported async_wrap object. PR-URL: #1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Setting flags using cryptic numeric object fields is confusing. Instead use much simpler .enable()/.disable() calls on the async_wrap object. PR-URL: #1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
It doesn't make sense to call before/after callbacks in init to the parent because they'll be made anyway from MakeCallback. If information does need to be propagated then it should be done automatically. Will deal with this if the issue arrises in the future. PR-URL: #1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Some calls to ReqWrap would get through the initial check and allow the init callback to run, even though the callback had not been used on the parent. Fix by explicitly checking if the parent has a queue. Also change the name of the check, and internal field of AsyncHooks. Other names were confusing. PR-URL: nodejs#1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Allow the init callback to see the PROVIDER type easily by being able to compare the flag with the list of providers on the exported async_wrap object. PR-URL: nodejs#1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Setting flags using cryptic numeric object fields is confusing. Instead use much simpler .enable()/.disable() calls on the async_wrap object. PR-URL: nodejs#1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
It doesn't make sense to call before/after callbacks in init to the parent because they'll be made anyway from MakeCallback. If information does need to be propagated then it should be done automatically. Will deal with this if the issue arrises in the future. PR-URL: nodejs#1614 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Finally getting around to finishing the
AsyncWrap
implementation. Here are some mostly minor changes. One specifically is breaking. Instead of needing to set the object field to enable/disable callbacks there are now methods on theasync_wrap
import. e.g.R=@bnoordhuis