-
in this discussion in fast stream lib airtai/faststream#1222 Can you describe my problem and why it must run in the main thread? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Each event loop in |
Beta Was this translation helpful? Give feedback.
Each event loop in
asyncio
can be used in a single thread only, see Python docs for explanation. So, you have to create dedicated event loop for each thread to run coroutines in them. Other that that I'm not aware of any obstacles to runaikoafka
in multithreaded environment. But I've actually never checked that, as it's hard to imagine where it would give any benefit.