betty.asyncio module#

Provide asynchronous programming utilities.

final class betty.asyncio.LazyReAwaitable#

Bases: ReAwaitable, Generic

A value that can be awaited multiple times while always returning the exact same value.

The proxied awaitable will at most be awaited once.

__init__(factory: Callable[[], Awaitable[ValueT]], /)#
class betty.asyncio.ReAwaitable#

Bases: ABC, Generic

A value that can be awaited multiple times.

async betty.asyncio.resolve_await(value: ResolvableAwaitable) T#

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