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.

This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.