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

is this part of nodejs or we still need to install this middleware from npm? #88

Open
shrimpy opened this issue Oct 17, 2016 · 5 comments

Comments

@shrimpy
Copy link

shrimpy commented Oct 17, 2016

Apologize in advance if this is not the place to ask question but report issue only.

I kind of lost when reading below link

nodejs/node-v0.x-archive#5243

does it mean it is now part of 0.x node and above that we do not need to install this middleware?

@osher
Copy link

osher commented Dec 12, 2016

AFAIK - it relays on a polyfill that creates process.addAsyncListener.
As long as process.addAsyncListener is not exposed - we're using the polyfill.

Every now and then we see commits on the node core related to work on async-listener, but again AFAIK - its' not out.

My test is:

$ node
> process.addAsyncListener
undefined

As long as you get undefined - we're on polyfill

@DeTeam
Copy link

DeTeam commented Dec 19, 2016

@osher @shrimpy nodejs/node-v0.x-archive#6011 not sure we ever gonna have this process.addAsyncListener.

@Qard
Copy link
Collaborator

Qard commented Jan 6, 2017

A CLS equivalent does not exist in node. For awhile, there was AsyncListener, which provided the appropriate hooks to layer this module on top of. In very recent versions of node there is an unstable feature called async_wrap, which is the intended replacement for AsyncListener and there is a fork of this module called cls-hooks to use that experimental feature. The official version of async_wrap should be available soon as async-hooks in node core, then this module will need to be converted to support that. Not yet sure if that'll happen as a merge of cls-hooks back to this module or as a separate rewrite--currently cls-hooks doesn't have a fallback for when async_wrap is unavailable, while this module does have a fallback for when AsyncListener is not available.

@osher
Copy link

osher commented Jan 10, 2017

Thanks for the update.

@randavidovitz
Copy link

@DeTeam thanks

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

No branches or pull requests

5 participants