All Questions
5 questions
0
votes
2
answers
875
views
Calling asyncio.run_coroutine_threadsafe across different event loops
I have a class inside a microservice that looks like this:
import asyncio
import threading
class A:
def __init__(self):
self.state = []
self._flush_thread = self._start_flush()
...
2
votes
2
answers
1k
views
Asyncio: legitimate multiple threads with event loops use cases?
Granted, given the GIL, classic asyncio design should focus on "single main thread with single event loop" in it. Nonetheless, are there legitimate "multiple threads with multiple event ...
4
votes
2
answers
11k
views
Python create_task does not work in running event loop
I have a simple piece of code driving me crazy for a while. I have posted this question some days ago asking create_task is not working with input. Now I have figured out something related to this. I ...
6
votes
2
answers
3k
views
Python 3.5 asyncio execute coroutine on event loop from synchronous code in different thread
I am hoping someone can help me here.
I have an object that has the ability to have attributes that return coroutine objects. This works beautifully, however I have a situation where I need to get ...
3
votes
1
answer
2k
views
Limiting simultaneously running asyncio coroutines with semaphores in a background thread
As an experiment with Python's new asyncio module, I created the following snippet to process a set of long running actions (jobs) in a background worker.
In an attempt to control the number of ...