betty.asyncio module

Provide asynchronous programming utilities.

async betty.asyncio.ensure_await(value: Awaitable[_T] | _T) → _T[source]

Return a value, but await it first if it is awaitable.

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

Wait for an awaitable in another thread.