IQMServerClientJob#
Module: iqm.iqm_server_client.iqm_server_client
- class iqm.iqm_server_client.iqm_server_client.IQMServerClientJob(data: JobData)#
Bases:
ABCABC for classes representing an IQMServerClient job.
Attributes
Methods
Cancel the job.
Search the timeline for an entry matching the given criteria.
Update the job data by querying the server.
Poll the server updating the job status, until the job reaches a terminal state, or until we hit a timeout.
- Parameters:
data (JobData)
- property status: JobStatus#
Last queried status of the job.
Note that this is not necessarily the same as the current status of the job, unless the status is terminal.
To get the current status, use
update().
- update() JobStatus#
Update the job data by querying the server.
Modifies
self.- Returns:
Current status of the job.
- Return type:
- cancel() None#
Cancel the job.
See
_IQMServerClient.cancel_job().- Return type:
None
- wait_for_completion(*, timeout_secs: float = 10800.0) JobStatus#
Poll the server updating the job status, until the job reaches a terminal state, or until we hit a timeout.
The terminal states are “completed”, “failed”, and “cancelled”.
Will stop the polling (but does not cancel the job) upon receiving a KeyboardInterrupt (Ctrl-C). If you want to cancel the job, call
cancel().Modifies
self.- Parameters:
timeout_secs (float) – If nonzero, stop polling after this many seconds and return the non-terminal status.
- Returns:
Last seen job status.
- Raises:
KeyboardInterrupt – Received Ctrl-C while waiting for the job to finish.
- Return type:
- find_timeline_entry(status: str, source: Literal['iqm-server', 'iqm-station-control'] | str | None = None) TimelineEntry | None#
Search the timeline for an entry matching the given criteria.
- Parameters:
- Returns:
The first matching entry or
Noneif the job timeline does not have any matching entries.- Return type:
TimelineEntry | None
Inheritance
