You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Reacted by Jeff Lewis, Peter Sandtner, Koichi Tanaka, Aidin, Piotr Mionskowski and 大鹏
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.
@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.
Activity
addaleax commentedon 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 commentedon Jun 8, 2017
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 commentedon Jun 8, 2017
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 commentedon Jun 8, 2017
@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 commentedon Sep 14, 2017
+1 :)
Add support for AsyncResource
papb commentedon Oct 1, 2019
Cool, looks like this was finally released (3.6.0), but how do I use this? Where is it documented?