crtm_poll.daemon package¶
Submodules¶
crtm_poll.daemon.daemon module¶
-
crtm_poll.daemon.daemon.
exec_and_write
(func, func_args, output_file, fetch_conf)[source]¶ Execute a given function with the given args and write the output to the given file preventing collisions with a lock.
Keyword arguments: func – callable function to execute func_args – list of arguments to pass to the executed function output_file – path to the file were to append the results fetch_conf – dictionary with configuration parameters for fetching the content
-
crtm_poll.daemon.daemon.
start_daemon
(func, func_args, output_file, interval: int = 60, processes: int = 5, max_conn_test: List[int] = None, fetch_conf: Dict[KT, VT] = {})[source]¶ Start a daemon that infinitely spawns a given function asynchronously every interval and writes the output to a file.
Keyword arguments: func – callable function to execute func_args – list of arguments to pass to the executed function output_file – path to the file were to append the results interval – number of seconds between spawns (the spawning period) processes – maximum number of simultaneously running spawned processes max_conn_test – Test different maximum (simultaneous) connections in
random order. Pass 4 integer values: start, stop, step and repetition (e.g. 5 101 5 1).fetch_conf – dictionary with configuration parameters for fetching the content