class documentation

class SyncronizerInterface(Protocol): (source)

View In Hierarchy

Protocol for objects capable of running awaitables synchronously.

Implementations expose a single run_sync method which executes an awaitable on an event loop owned by the implementation and blocks the caller until completion.

Method run_sync Run awaitable to completion and return its result.
def run_sync(self, awaitable: Awaitable[T], timeout: float | None = None) -> T: (source) ΒΆ

Run awaitable to completion and return its result.

Parameters
awaitable:Awaitable[T]The awaitable to execute on the synchronizer's loop.
timeout:float | NoneOptional wall-clock timeout in seconds.
Returns
TThe result of the awaitable.