-
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_wrap: make native API public #3504
Conversation
ProviderType provider, | ||
AsyncWrap* parent) | ||
: BaseObject(isolate, object), bits_(static_cast<uint32_t>(provider) << 1) { | ||
CHECK_NE(provider, PROVIDER_NONE); |
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 just have a separate Init
function or whatever, to avoid duplication
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.
Yup. I left it this way wanting to just get something building. I'll fix it up. :)
I think it is a bit duplicated, but otherwise looking pretty good! |
Is this meant as an alternative to setting the |
@AndreasMadsen I've been pondering that. Do you use that logic? Nothing in node currently does, and if there's no usage I was thinking I'd simply remove the logic all together. Since @indutny is requesting we make |
I forgot... we're not labeling the asyncwrap stuff yet ;-) |
82015ad
to
8556434
Compare
@trevnorris No I don't use the I would much rather see the AsyncWrap class being used properly and perhaps integrated into the |
ProviderType provider, | ||
AsyncWrap* parent) | ||
: BaseObject(isolate, object), bits_(static_cast<uint32_t>(provider) << 1) { | ||
Environment* env = Environment::GetCurrent(isolate); |
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.
Exactly!
8556434
to
719d647
Compare
Rough attempt to allow AsyncWrap to be include'able in a module.
719d647
to
238be1c
Compare
LGTM, but I would like to have @bnoordhuis review too |
Local<Object> object, | ||
ProviderType provider, | ||
AsyncWrap* parent) | ||
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) { |
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.
Maybe make bits_
a uintptr_t so there is room to change it to a pointer without breaking ABI.
It's not entirely clear to me why the changes to |
@bnoordhuis Specifically because of inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle)
: handle_(env->isolate(), handle),
env_(env) { Which requires including |
@trevnorris What is the status? |
From conversation I had with @bnoordhuis:
|
😢 |
@trevnorris Another reason for making AsyncWrap public was so native addons could integrate with AsyncWrap. But I suspect it can be done with a simple API and integers. |
@AndreasMadsen I hypothetically like the idea of doing this, and will continue to think about another way this could be done more elegantly. |
Rough attempt to allow AsyncWrap to be include'able in a module.
R=@bnoordhuis
R=@indutny
This is a WIP, and am only posting for critique on the approach. Tests still need to be added, and one of them fixed.