betty.asyncio module - Betty 0.4.0a3 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.asyncio module

Provide asynchronous programming utilities.

async betty.asyncio.gather(*coroutines: Coroutine[Any, None, betty.asyncio._T]) → tuple[betty.asyncio._T, ...]

  Gather multiple coroutines.

  This is like Python’s own `asyncio.gather`, but with improved error handling.

  Parameters:

    coroutines (`typing.Coroutine`[`typing.Any`, `None`, `typing.TypeVar`(`_T`)])

  Return type:

    `tuple`[`typing.TypeVar`(`_T`), `...`]

betty.asyncio.wait_to_thread(f: Awaitable[betty.asyncio._T]) → betty.asyncio._T

  Wait for an awaitable in another thread.

  Parameters:

    f (`typing.Awaitable`[`typing.TypeVar`(`_T`)])

  Return type:

    `typing.TypeVar`(`_T`)