qcg.pilotjob.executor_api.qcgpj_future module¶
-
class
qcg.pilotjob.executor_api.qcgpj_future.
QCGPJFuture
(ids, qcgpjm)¶ Bases:
object
QCG-PilotJob Future tracks execution of tasks submitted to QCG-PilotJob via QCGPJExecutor.
Parameters: - ids (list(str)) – list of identifiers of tasks submitted to a QCG-PilotJob manager
- qcgpjm (LocalManager) – QCG-PilotJob manager instance, to which tasks have been submitted
Returns: Return type: None
-
result
(timeout=None)¶ Waits for finish of tasks assigned to this future and once finished results their statuses.
This method waits until all tasks assigned to the future are executed (successfully or not). The QCG-PilotJob manager is periodically polled about status of not finished jobs. The poll interval (2 sec by default) can be changed by defining a ‘poll_delay’ key with appropriate value (in seconds) in configuration of instance.
Parameters: timeout (int) – currently not used Returns: Return type: dict - a map with tasks names and their terminal status
-
done
()¶ Checks if the future has been finished
Checks if all tasks assigned to the future are already finished.
Returns: Return type: True if all tasks are finished, False otherwise
-
running
()¶ Checks if the future is still running
Checks if any of tasks assigned to the future are still running.
Returns: Return type: True if any of tasks is still running, False otherwise
-
cancel
()¶ Cancels the future
Cancels all tasks assigned to the future.
Returns: Return type: True if the operation succeeded.
-
cancelled
()¶ Checks if the future has been already cancelled
Checks if the future, and by consequence all the tasks assigned to this future, have been cancelled.
Returns: Return type: True if the future has been cancelled, False otherwise.