Creates async background tasks in a way that is safe from garbage collection.
async def my_coro(x: int) -> int: return x + 1
safely submits my_coro for background execution¶
Runs a synchronous function in an asynchronous manner.
Runs a coroutine from a synchronous context, either in the current event loop or in a new one if there is no event loop running. The coroutine will block until it is done. A thread will be spawned to run the event loop if necessary, which allows coroutines to run in environments like Jupyter notebooks where the event loop runs on the main thread.