Skip to content

yggdrasil.concurrent.job_result

job_result

Immutable result wrapper for an async job.

JobResult dataclass

JobResult(result: Optional[T], exception: Optional[BaseException])

Bases: Generic[T]

Immutable outcome of a :class:~yggdrasil.concurrent.job.Job execution.

Either holds a result (success) or an exception (failure). Both fields are always present; exactly one is None in the normal case.

ok property

ok: bool

True when the job succeeded (no exception captured).

get

get() -> T

Return the result or re-raise the captured exception.

Raises:

Type Description
BaseException

The exception that was captured during job execution.