Utils to work with executors
Module Contents
-
plynx.utils.executor.
CONNECT_POST_TIMEOUT
= 1.0[source]
-
plynx.utils.executor.
REQUESTS_TIMEOUT
= 10[source]
-
plynx.utils.executor.
urljoin
(base: str, postfix: str) → str[source]
Join urls in a reasonable way
-
plynx.utils.executor.
post_request
(uri, data, num_retries=3)[source]
Make post request to the url
-
plynx.utils.executor.
_update_node
(node: plynx.db.node.Node)[source]
Update node in the database
-
plynx.utils.executor.
materialize_executor
(node: Union[Dict[str, Any], plynx.db.node.Node]) → BaseExecutor[source]
Create a Node object from a dictionary
- Parameters:
- node: dictionary representation of a Node or the node itself
- Returns:
- Executor: Executor based on the kind of the Node and the config
-
class
plynx.utils.executor.
TickThread
(executor: BaseExecutor)[source]
This class is a Context Manager wrapper.
It calls method tick() of the executor with a given interval
-
TICK_TIMEOUT
:int = 1[source]
-
__enter__
(self)[source]
Currently no meaning of returned class
-
__exit__
(self, type_cls, value, traceback_val)[source]
-
call_executor_tick
(self)[source]
Run timed ticks
-
class
plynx.utils.executor.
DBJobExecutor
(executor: BaseExecutor)[source]
Executes a single job in an executor and updates its status.
-
run
(self)[source]
Run the job in the executor
-
kill
(self)[source]
Kill the running job