yggdrasil.concurrent.threading.base¶
base ¶
AsyncJob — abstract awaitable handle for an async operation.
AsyncJob ¶
Bases: ABC, Generic[T]
Abstract handle for an async operation that can be awaited.
Implementors must provide :meth:wait, :attr:is_done, and :meth:result.
is_done
abstractmethod
property
¶
True when the job has finished (success or failure).
wait
abstractmethod
¶
Block until the job completes and return its result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wait
|
WaitingConfigArg
|
|
None
|
raise_error
|
bool
|
Re-raise the job's exception when |
True
|
Returns:
| Type | Description |
|---|---|
Optional[T]
|
The job's return value, or |
Optional[T]
|
miss (when |
Raises:
| Type | Description |
|---|---|
TimeoutError
|
If a timed wait elapses before the job finishes. |
BaseException
|
Any exception raised by the job (when |
result
abstractmethod
¶
Return the :class:~yggdrasil.concurrent.job_result.JobResult if done, else None.