Книга: Learning Concurrency in Python
Назад: The as_completed(fs, *, loop=None, timeout=None) function
Дальше: The wrap_future(future, *, loop=None) function

The ensure_future(coro_or_future, *, loop=None) function

The ensure_future function will schedule the execution of a coroutine object--wrap it in a future and then return a task object:

import asyncio

async def myCoro():
print(“myCoro”)

task = asyncio.ensure_future(myCoro())
Назад: The as_completed(fs, *, loop=None, timeout=None) function
Дальше: The wrap_future(future, *, loop=None) function