Ice.FutureLike

class Ice.FutureLike(*args, **kwargs)

Bases: Protocol[_T_co]

A protocol that defines the interface for objects that behave like a Future.

add_done_callback(callback: Callable[[FutureLike], Any], /) None

Add a callback to be run when the Future is done.

Parameters:

callback (Callable[[FutureLike], Any]) – A callable that takes the Future object as its only argument. Will be called when the Future completes (successfully, with exception, or cancelled).

Return type:

None

Note: Using positional-only parameter (/) to match both asyncio and

concurrent.futures implementations regardless of parameter name.

result(timeout: int | float | None = None) _T_co

Return the result of the Future.

Parameters:

timeout (int | float | None)

Return type:

_T_co