-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Expose isNewCoroutine from CopyableThreadContextElement #3902
Comments
Related #3414 |
Do you have an approach in mind to retain backwards compatibility? |
Deprecate the old API, and make the new API delegate to the old API by default. Then users has to at least override one of them. If both are overriden, then only the override for the new API will be used.
|
Hi, any thoughts on this proposal? An alternative way with regard to compatibility issue:
Make |
Hi, any updates for the issue? having distinction between new coroutine and switching context will make our tracing clients life easier, so that they don't need to manually set ThreadLocal everywhere, only for launches. Thanks! |
Use case
Hi, all. Our tracing system is based on ThreadLocal. To not lose changes to our ThreadLocal, we store the object in
CopyableThreadContextElement
.The above solution works fine for us, but we only want to propagate our object when used with
withContext
, we don't want to propagate the state intolaunch
, because we as a tracing system, only considerwithContext
as part of the execution of the enclosing code block, since it is blocking, whilelaunch
is not.Therefore, we hope there is a way to tell whether the
CopyableThreadContextElement
is created forwithContext
orlaunch
, and I noticed coroutine implementation already has a boolean isNewCoroutine indicating the difference, and I wonder if is possible to expose this flag from copyForChild, thanks!The Shape of the API
The text was updated successfully, but these errors were encountered: