fermioniq.client.Client.subscribe_to_events#

Client.subscribe_to_events(job_id: str, on_msg_callback: Callable[[EmulatorMessage], None] | None = None, cancel_on_interrupt: bool = False) None | Task[None]#

Subscribe to job status changes and execute a callback function when status changes.

Parameters:
job_id

The ID of the job to subscribe to.

on_msg_callback

A callback function to be executed when job status changes.

cancel_on_interrupt

If True, and return_as_task is False, the job will be cancelled on Keyboard interrupt signal.

Returns:
task

None if return_as_task is False, otherwise an asyncio.Task object.