Message370261
The default policy of asyncio deliberately limits automatic creation of event loops to the main thread. You can't just mix asyncio with a threaded web application and expect it to work correctly.
See https://github.com/python/cpython/blob/a487a39dca4c41305928c7dfdbcb0b3aa344683b/Lib/asyncio/events.py#L609-L620
In this policy, each thread has its own event loop. However, we
only automatically create an event loop by default for the main
thread; other threads by default have no event loop.
Other policies may have different rules (e.g. a single global
event loop, or automatically creating an event loop per thread, or
using some other notion of context to which an event loop is
associated). |
|
Date |
User |
Action |
Args |
2020-05-28 18:55:11 | christian.heimes | set | recipients:
+ christian.heimes, asvetlov, python-dev, yselivanov, Christian Exposito |
2020-05-28 18:55:11 | christian.heimes | set | messageid: <1590692111.53.0.991314997789.issue40811@roundup.psfhosted.org> |
2020-05-28 18:55:11 | christian.heimes | link | issue40811 messages |
2020-05-28 18:55:11 | christian.heimes | create | |
|