Skip to main content

All 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() ...
thegreatcoder's user avatar
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 ...
Andrei Pozolotin's user avatar
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 ...
Nafees Anwar's user avatar
  • 6,628
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 ...
Cliff Hill's user avatar
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 ...
ImapUkua's user avatar