-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Fix for current_message
while operating under AsyncIO
#593
Conversation
This looks good, thanks! One question, thouhg, because I haven't been keeping up with contextvars. Do you know if they play well with gevent? |
They play well with gevent, but you need pass it to greenlet.gr_context attribute |
Yeah, I read this, didn't dig crazy into the
Full disclosure, I did have to modify the |
Looks like async_to_sync do not copyback contextvars. New test check contextvars copy into asyncio thread, but not back. I think copyback contextvars is needed cause It's not for that PR, but who knows :) |
You mean to have a thread modify an original |
Yes, if Right now we fix situation when changes in caller thread not reflected in asyncio thread, but we have other side - changes in asyncio should reflect caller thread. Of course i'm talking only about |
Gotcha -- but that wouldn't impact the
This sounds like net new direct functionality (versus an artifact of how the |
Hmm ... looks like a problem with the rabbitmq server in the CI for those unit tests that failed |
Thanks! |
Moved from
locals
tocontextvars
to address issues while running underAsyncIO
.Fixes #586