qrisp.interface.Job.result#
- abstractmethod Job.result(timeout: float | None = None) JobResult[source]#
Block until the job reaches a terminal state and return its result.
This is a blocking call: it does not return until the job is in one of the terminal states:
DONE,CANCELLED, orERROR. The internal synchronisation mechanism (threading, polling, asyncio, etc.) is left entirely to the concrete implementation.If the job is already in a terminal state when this method is called, it must return (or raise) immediately without blocking.
Concrete implementations should call
_raise_for_status()once the terminal state has been reached, before returning.- Parameters:
- timeoutfloat or None, optional
Maximum number of seconds to wait for the job to finish.
None(default) waits indefinitely. Implementations that support this parameter should raiseTimeoutErrorwhen the deadline expires.
- Returns:
- JobResult
The measurement results, if the job completed successfully (
DONE).
- Raises: