concurrency.py 188 Bytes
Newer Older
Juraj Sloboda's avatar
Juraj Sloboda committed
1 2 3 4
import asyncio


async def run_concurrently(*args):
Juraj Sloboda's avatar
Juraj Sloboda committed
5
    await asyncio.wait([asyncio.create_task(coro) for coro in args])
Juraj Sloboda's avatar
Juraj Sloboda committed
6 7


Juraj Sloboda's avatar
Juraj Sloboda committed
8 9
def async_run(*args, **kwargs):
    asyncio.run(*args, **kwargs)