[Python-ideas] asyncio futures and tasks with synchronous callbacks

2019-07-30 Thread Aurélien Lambert
In asyncio, when a task awaits for another task (or future), it can be cancelled right after the awaited task finished. Thus, if the awaited task has consumed data, the data is lost. For instance, with the following code: import asyncio available_data = [] data_ready = asyncio.Future

[Python-ideas] asyncio: futures and tasks with synchronous callbacks

2019-07-30 Thread aurelien . lambert . 89
In asyncio, when a task awaits for another task (or future), it can be cancelled right after the awaited task finished (before the callback have been processed). Thus, if the awaited task has consumed data, the data is lost. For instance, with the following code: import asyncio availab