-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for synchronous event loops #14
Comments
I just don't understand how this would make the code manifest the necessary |
there's also the case for twisted in greenlet or asyncio in greenlet (and them both), eg running async sqlalchemy on pytest-twisted |
I do not understand how gevent is related to async/await. As said in the OP, I would like the option for sniffio to be able to report synchronous event loops such as running inside a greenlet. Then when writing for example a sync library like redis-py it could query if it's running under a greenlet and do different code instead of using regular I/O (thus not requiring monkey patching). |
Ah, I got confused. Nevermind! |
The same principle that exists in the asynchronous world, exists in the synchronous world as well.
I've been bitten enough by gevent's monkey patching, that I think that if library writers had an option to detect a code is running via a greenlet or normal (threaded?), it could create code that automatically knows which primitives to use.
@jamadden This could make libraries like this (which is the basis of httpx) auto detect and use gevent as well (without monkey patching) ?
https://github.com/encode/httpcore/tree/master/httpcore/_backends
The text was updated successfully, but these errors were encountered: