Skip to content
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_hooks support #1403

Closed
overlookmotel opened this issue Jun 5, 2017 · 6 comments
Closed

async_hooks support #1403

overlookmotel opened this issue Jun 5, 2017 · 6 comments

Comments

@overlookmotel
Copy link
Contributor

Hi.

Now that async_hooks is in Node 8, would you consider supporting it in bluebird?

I've been following the evolution of async_hooks and have a fair idea of how the JS embedder API works, but am much less familiar with bluebird's internals. I would be happy to prepare a PR to add async_hooks support if someone could perhaps give me a pointer as to where to begin in bluebird's codebase?

Many thanks.

@addaleax
Copy link

addaleax commented Jun 8, 2017

I’d recommend waiting a bit because we’re still working out a few kinks with regard to async_hooks + native Promises in Node core; but generally, we’d be up for helping where we can.

@benjamingr
Copy link
Collaborator

Look for where domains are used - and add the hooks there (optionally as a config).

Should be pretty straightforward :)

If you or @addaleax want to work on it I'll merge after review and @petkaantonov will do a release

@addaleax
Copy link

addaleax commented Jun 8, 2017

Should be pretty straightforward :)

https://github.com/nodejs/node/issues?utf8=%E2%9C%93&q=label%3Aasync_hooks%20label%3Apromises … there’s quite a bit to read up on, and we are definitely not done implementing this in core. @overlookmotel You are welcome to jump into those threads or ask questions if you have any, this is the kind of thing where it’s really good to get as many clever eyes on it as possible.

@benjamingr
Copy link
Collaborator

@addaleax correct me if I'm wrong - but we could use the existing domain infrastructure in bluebird to easily do this - no?

Bluebird already had to solve the difficult question of contexts through resolution scenarios and assimilation of foreign libraries. Bluebird has 4 years of battle tested domain support (compared to your great but recent work in Node when you led and we worked on .promisify).

I'm far from being a domain expert on async hooks (pun unintended) but bluebird shouldn't have as hard of a job as core doing this.

@jbrumwell
Copy link

+1 :)

@papb
Copy link
Contributor

papb commented Oct 1, 2019

Cool, looks like this was finally released (3.6.0), but how do I use this? Where is it documented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants