Top "Python-asyncio" questions

This tag is to be used for the asyncio Python package which provides mechanisms for writing single-threaded concurrent code.

How to gracefully timeout with asyncio

So before adding try/catch block my event loop closed gracefully when process ran for less than 5 minutes, but after …

python-3.x async-await runtime-error python-asyncio timeoutexception
How to mock asyncio coroutines?

The following code fails with TypeError: 'Mock' object is not iterable in ImBeingTested.i_call_other_coroutines because I've replaced …

python python-3.x unit-testing mocking python-asyncio
Python: what are the advantages of async over threads?

I've had a hard time trying to understand how and why async functionality works in python and I am still …

python multithreading asynchronous async-await python-asyncio
Asyncio RuntimeError: Event Loop is Closed

I'm trying to make a bunch of requests (~1000) using Asyncio and the aiohttp library, but I am running into a …

python python-3.x python-asyncio aiohttp
python asyncio, how to create and cancel tasks from another thread

I have a python multi-threaded application. I want to run an asyncio loop in a thread and post calbacks and …

python multithreading python-multithreading python-asyncio
Python Asyncio - RuntimeError: Cannot close a running event loop

I'm trying to resolve this error: RuntimeError: Cannot close a running event loop in my asyncio process. I believe it's …

python python-3.6 python-asyncio aiohttp
using serial port in python3 asyncio

i'm trying and, so far, failing to use python asyncio to access a serial port. i'd really appreciate any tips …

python serial-port python-3.4 pyserial python-asyncio
When to use and when not to use Python 3.5 `await` ?

I'm getting the flow of using asyncio in Python 3.5 but I haven't seen a description of what things I should …

python python-asyncio python-3.5
asyncio queue consumer coroutine

I have a asyncio.Protocol subclass receiving data from a server. I am storing this data (each line, because the …

python python-3.x coroutine python-asyncio
python asyncio add_done_callback with async def

I have 2 functions: The first one, def_a, is an asynchronous function and the second one is def_b which …

python python-3.x async-await python-asyncio coroutine