plynx.base.executor
¶
Templates for PLynx Executors and utils.
Module Contents¶
-
class
plynx.base.executor.
BaseExecutor
(node: Optional[Node] = None)[source]¶ Bases:
abc.ABC
Base Executor class
-
run
(self, preview: bool = False)[source]¶ Main execution function.
- Workdir has been initialized.
- Inputs are not preprocessed.
- Outputs shoul be manually postprocessed.
- It is OK to raise an exception in this function.
- Returns:
- enum: plynx.constants.NodeRunningStatus
-
launch
(self)[source]¶ Launch the Node on the backend.
The difference between launch() and run() is that: - run() assumes synchronous execution. - launch() does not necessary have this assumtion. Use get_node_running_status to get the status of the execution.
- Returns:
- RunningStatus
-
get_running_status
(self)[source]¶ Returns the status of the execution.
Async executions should sync with the remote and return the result immediately.
-
kill
(self)[source]¶ Force to kill the process.
The reason can be the fact it was working too long or parent executor canceled it.
-
is_updated
(self)[source]¶ Function that is regularly called by a Worker.
The function is running in a separate thread and does not block execution of run().
- Returns:
- (bool): True if worker needs to update DB else False
-
-
class
plynx.base.executor.
Dummy
[source]¶ Bases:
plynx.base.executor.BaseExecutor
Dummy Executor. Used for static Operations