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

CLSContext now supports continuations with async-await #201

Closed
wants to merge 1 commit into from
Closed

CLSContext now supports continuations with async-await #201

wants to merge 1 commit into from

Conversation

Ghost---Shadow
Copy link

@Ghost---Shadow Ghost---Shadow commented Mar 31, 2018

continuation-local-storage has issues with async-await so someone made a library called cls-hooked which fixes that problem.

This PR merely changes the dependency from cls to cls-hooked.

Also, added a test case to demonstrate the phenomenon.

Possible duplicate #135

Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for beginning this

There are a number of similar issues and perhaps even pull requests. Can you please note them in this issue and ping people from those issues to review this?


async function newP(id) {
const {cid1, cid2} = await ctx.letContext(id, () => afn());
// console.log(cid1, cid2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the commented out stuff

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

}
}
},
"parser": "babel-eslint"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, eslint was freaking out.

package.json Outdated
@@ -33,4 +33,4 @@
"workspaces": [
"packages/*"
]
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to change your settings to ensure EOL before EOF

@Ghost---Shadow
Copy link
Author

Going through #135 I was thinking what about creating a new folder zipkin-context-cls-hooked and leaving the original zipkin-context-cls as it is.

What do you think?

@codefromthecrypt
Copy link
Member

@Ghost---Shadow just to keep us from hopping issues too much. what's your idea on doing that? ex the why not the what. I know we've had some debates about how to keep the build running in various fashions and a lot of people have participated in these discussions. Would be nice to summarize work before this, what it solves from previous attempts, what it doesn't solve, how it addresses the build concerns, any compat impact with regards to react native or browser (like angular) apps.

@Ghost---Shadow
Copy link
Author

@adriancole I am afraid that I am not knowledgeable enough to have opinions on this subject matter.

However, I urgently need this feature for a project so I created a new npm package called zipkin-context-cls-hooked.

  1. If you decide it to merge this as zipkin-context-cls. Then I will deprecate my package and link to this repo.
  2. If you decide to create a new package zipkin-context-cls-hooked then I will unpublish my package and publish the one in this repo, so that npm points to the right thing.

@codefromthecrypt
Copy link
Member

codefromthecrypt commented Apr 4, 2018 via email

@evan-scott-zocdoc
Copy link

Would this fix #88 (comment) in terms of how express async middlewares are handled via CLSContext?

@Ghost---Shadow
Copy link
Author

Give it a try.

@justlaputa
Copy link
Contributor

justlaputa commented May 15, 2018

Hi I'm coming to this issue because I met same problem, may I ask how is this issue now? it will get merged? Thanks!

@codefromthecrypt
Copy link
Member

@eirslett @DanielMSchmidt considering this: https://medium.com/airbnb-engineering/sunsetting-react-native-1868ba28e30a

do we continue to support (watch out for conflicts with) react native? This topic has locked up a number of issues I'm afraid.

@DanielMSchmidt
Copy link
Contributor

@adriancole I would not say React Native is dying just because AirBnB decides to move away from it. That being said, we only have one version of zipkin.js that actually works in a none node environment, the current versions are broken anyway, so why care 🤷‍♂️

I haven't had the time and energy to put up meaningful E2E tests for either the browser or React Native (I think having one of the two would be a good start), sorry about that.

@jcchavezs
Copy link
Contributor

Any chance to continue with this @Ghost---Shadow?

@Ghost---Shadow
Copy link
Author

Ghost---Shadow commented Mar 29, 2019

@jcchavezs I dont even remember what this was :P

I guess not. I have moved on.

EDIT: I made a fork of this repo with this PR. You can find it here.

npm install zipkin-context-cls-hooked

@r4j4h
Copy link

r4j4h commented Sep 10, 2019

@Ghost---Shadow where does your fork's code live? The npm page has this project set as its home page and both Google search and Github search are failing me.

zipkin-context-cls-hooked's npm readme even instructs using "zipkin-context-cls", so it feels rather hastily set up and unmaintained. There was conversation #135 (comment) to have it live in https://github.com/openzipkin-contrib but this has not been done.

Just curious about the actual state of this. :)

@Ghost---Shadow
Copy link
Author

Ghost---Shadow commented Sep 11, 2019

@r4j4h I just forked and fixed it for my personal use, I dont care what others are doing :)

https://github.com/Ghost---Shadow/zipkin-js/tree/bugfix/asyc-await

Anyway, I will resolve the merge conflicts

@Ghost---Shadow
Copy link
Author

As promised I have deprecated the package

https://www.npmjs.com/package/zipkin-context-cls-hooked

@jcchavezs
Copy link
Contributor

jcchavezs commented Jun 5, 2020 via email

@Ghost---Shadow
Copy link
Author

Ghost---Shadow commented Jun 5, 2020

@jcchavezs I dont use it anymore. There are 200+ weekly downloads. People are using that.

There are no PRs to my repository.

They should be notified the next time they do an npm install

@Ghost---Shadow Ghost---Shadow deleted the bugfix/asyc-await branch June 5, 2020 15:52
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

Successfully merging this pull request may close these issues.

7 participants