Bases: Protocol[ResultT]
Future protocol.
This Protocol
is useful for type checking future
types that do not inherit from Future
(such as Dask's Future
).
This protocol does not require running()
because Dask does not provide
that method.
add_done_callback
Add a done callback to the future.
Source code in taps/future.py
| def add_done_callback(
self,
callback: Callable[[FutureProtocol[ResultT]], Any],
) -> None:
"""Add a done callback to the future."""
...
|
cancel
Attempt to cancel the task.
Source code in taps/future.py
| def cancel(self) -> bool:
"""Attempt to cancel the task."""
...
|
cancelled
Check if the task was cancelled.
Source code in taps/future.py
| def cancelled(self) -> bool:
"""Check if the task was cancelled."""
...
|
done
Check if the task is done.
Source code in taps/future.py
| def done(self) -> bool:
"""Check if the task is done."""
...
|
exception
Get the exception raised by the task.
Source code in taps/future.py
| def exception(self, timeout: float | None = None) -> BaseException | None:
"""Get the exception raised by the task."""
...
|
result
result(timeout: float | None = None) -> ResultT
Get the result of the task.
Source code in taps/future.py
| def result(self, timeout: float | None = None) -> ResultT:
"""Get the result of the task."""
...
|