flowserv.controller.remote.monitor module
Monitor for remote workflow executions. The monitor is a separate thread that continously polls the remote workflow engine to update the workflow state in the local database.
- class flowserv.controller.remote.monitor.WorkflowMonitor(workflow: flowserv.controller.remote.client.RemoteWorkflowHandle, poll_interval: float, service: flowserv.service.api.APIFactory, tasks: Dict)
Bases:
threading.ThreadThread that monitors execution of an external workflow. Polls the state of the workflow in regular intervals. Updates the local workflow state as the remote state changes.
- run()
Poll the remote server continuously until execution is finished.
- flowserv.controller.remote.monitor.monitor_workflow(workflow: flowserv.controller.remote.client.RemoteWorkflowHandle, poll_interval: float, service: Optional[flowserv.service.api.APIFactory] = None) flowserv.model.workflow.state.WorkflowState
Monitor a remote workflow run by continuous polling at a given interval. Updates the local workflow state as the remote state changes.
Returns the state of the inactive workflow and the temporary directory that contains the downloaded run result files. The run directory may be None for unsuccessful runs.
- Parameters
workflow (flowserv.controller.remote.client.RemoteWorkflowHandle) – Handle for the monitored workflow.
poll_interval (float) – Frequency (in sec.) at which the remote workflow engine is polled.
service (contextlib,contextmanager, default=None) – Context manager to create an instance of the service API.
- Return type