GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — async_wrap: make native API public by trevnorris · Pull Request #3504 · nodejs/node

Conversation

@trevnorris

@trevnorris trevnorris commented Oct 23, 2015

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@trevnorris trevnorris added the c++ Issues and PRs that require attention from people who are familiar with C++. label Oct 23, 2015
indutny
indutny reviewed Oct 24, 2015
View reviewed changes
Comment thread src/async-wrap.cc Outdated

@indutny indutny Oct 24, 2015

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@trevnorris trevnorris Oct 26, 2015

Copy link
Copy Markdown
Contributor Author

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. :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@indutny

indutny commented Oct 24, 2015

Copy link
Copy Markdown
Member

I think it is a bit duplicated, but otherwise looking pretty good!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen

AndreasMadsen commented Oct 24, 2015

Copy link
Copy Markdown
Member

Is this meant as an alternative to setting the _asyncQueue property on the this object when using MakeCallback?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen AndreasMadsen mentioned this pull request Oct 26, 2015
[async_hooks] tracking issue nodejs/diagnostics#29
Closed
23 of 27 tasks
@trevnorris

trevnorris commented Oct 26, 2015

Copy link
Copy Markdown
Contributor Author

@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 AsyncWrap public anyway users could then hook into that mechanism instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added semver-minor PRs that contain new features and should be released in the next minor version. and removed semver-minor PRs that contain new features and should be released in the next minor version. labels Oct 26, 2015
@jasnell

jasnell commented Oct 26, 2015

Copy link
Copy Markdown
Member

I forgot... we're not labeling the asyncwrap stuff yet ;-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris
trevnorris force-pushed the make-async-wrap-public branch from 82015ad to 8556434 Compare October 26, 2015 17:46
@trevnorris

trevnorris commented Oct 26, 2015

Copy link
Copy Markdown
Contributor Author

@indutny My attempt at de-duplicating the code. Feel like there's a better way, but nothing is apparent.

@jasnell Hopefully soon. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen

AndreasMadsen commented Oct 26, 2015

Copy link
Copy Markdown
Member

@trevnorris No I don't use the _asyncQueue property and I haven't seen any module that does. I think it is an odd design, since they init hook has to be called manually anyway (in most usecases). And if that is done, you are so deep into AsyncWrap that you might as well call the pre and post hooks yourself.

I would much rather see the AsyncWrap class being used properly and perhaps integrated into the Nan:: Callback class or similar.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

indutny
indutny reviewed Oct 26, 2015
View reviewed changes
Comment thread src/async-wrap.cc Outdated

@indutny indutny Oct 26, 2015

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@trevnorris
trevnorris force-pushed the make-async-wrap-public branch from 8556434 to 719d647 Compare October 26, 2015 20:05
@trevnorris
async_wrap: make native API public
238be1c
Rough attempt to allow AsyncWrap to be include'able in a module.
@trevnorris
trevnorris force-pushed the make-async-wrap-public branch from 719d647 to 238be1c Compare October 26, 2015 20:24
@indutny

indutny commented Oct 26, 2015

Copy link
Copy Markdown
Member

LGTM, but I would like to have @bnoordhuis review too

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Nov 10, 2015
View reviewed changes
Comment thread src/async-wrap.cc Outdated

@bnoordhuis bnoordhuis Nov 10, 2015

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Nov 10, 2015

Copy link
Copy Markdown
Member

It's not entirely clear to me why the changes to src/base-object* are necessary. Were you planning on making those public as well?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris

trevnorris commented Nov 10, 2015

Copy link
Copy Markdown
Contributor Author

@bnoordhuis Specifically because of

inline BaseObject::BaseObject(Environment* env, v8::Local<v8::Object> handle)
    : handle_(env->isolate(), handle),
      env_(env) {

Which requires including env.h and env-inl.h. Neither of which can be included by the user. But since async-wrap-inl.h included base-object.h I was still getting build errors. Though, by moving everything out of async-wrap-inl.h to async-wrap.cc that may resolve the issue by itself.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott force-pushed the master branch from 1e896a6 to 082cc8d Compare December 27, 2015 02:00
@AndreasMadsen

AndreasMadsen commented Jan 3, 2016

Copy link
Copy Markdown
Member

@trevnorris What is the status?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen AndreasMadsen mentioned this pull request Jan 8, 2016
Tracing WG Meeting 2016-01-26 nodejs/diagnostics#38
Closed
@trevnorris

trevnorris commented Jan 11, 2016

Copy link
Copy Markdown
Contributor Author

From conversation I had with @bnoordhuis:

<bnoordhuis> remember i [sic] wrote base-object.h so we could stop using ObjectWrap in core, which we couldn't change easily because it was public
<trevnorris> hah. true.
<trevnorris> i'm just experimenting w/ making AsyncWrap public at indutny's request. it's nothing I have my mind set on.
<bnoordhuis> i'd take the unix file descriptor approach: give the user an integer that represents the object and hide everything else
<bnoordhuis> don't expose complex api, it always ends in tears
<trevnorris> think the reason is indutny wants to expose JSStream as a public native API, which depends on AsyncWrap.
<bnoordhuis> exposing JSStream seems like it's guaranteed to end in tears, only question is whose tears
<bnoordhuis> mine, at the very least
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@indutny

indutny commented Jan 12, 2016

Copy link
Copy Markdown
Member

😢

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AndreasMadsen

AndreasMadsen commented Jan 12, 2016

Copy link
Copy Markdown
Member

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris

trevnorris commented Jan 14, 2016

Copy link
Copy Markdown
Contributor Author

@AndreasMadsen I hypothetically like the idea of doing this, and will continue to think about another way this could be done more elegantly.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris trevnorris closed this Mar 28, 2016
@trevnorris
trevnorris deleted the make-async-wrap-public branch March 28, 2016 22:27
This was referenced Apr 29, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#375
Open
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#379
Open
This was referenced Jun 22, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#494
Open
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#532
Open
[Snyk] Security upgrade karma from 4.4.1 to 5.0.8 aliscco/alisco-node#562
Open
[Snyk] Security upgrade karma from 4.4.1 to 5.0.8 aliscco/alisco-node#595
Open
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#614
Open
@leonardoadame leonardoadame mentioned this pull request Jul 9, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 leonardoadame/node#143
Open
@aliscco aliscco mentioned this pull request Oct 27, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#646
Open
@aliscco aliscco mentioned this pull request Nov 28, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#695
Open
This was referenced Nov 29, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 leonardoadame/node#211
Open
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 leonardoadame/node#268
Open
@aliscco aliscco mentioned this pull request Dec 2, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 aliscco/alisco-node#1024
Open
@leonardoadame leonardoadame mentioned this pull request Dec 3, 2023
[Snyk] Security upgrade karma from 3.1.4 to 5.0.8 leonardoadame/node#479
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@trevnorris @indutny @AndreasMadsen @jasnell @bnoordhuis
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.