Skip to content

How can run aiokafka multi thread #979

Answered by ods
alm0ra asked this question in Q&A
Discussion options

You must be logged in to vote

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 run aikoafka in multithreaded environment. But I've actually never checked that, as it's hard to imagine where it would give any benefit.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alm0ra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants