def __init__(self, server_url, thread_count, polling_interval, worker_id=None): """ Parameters ---------- server_url: str The url to the server hosting the conductor api. Ex: 'http://localhost:8080/api' thread_count: int The number of threads that will be polling for and executing tasks in case of using the start method. polling_interval: float The number of seconds that each worker thread will wait between polls to the conductor server. worker_id: str, optional The worker_id of the worker that is going to execute the task. For further details, refer to the documentation By default, it is set to hostname of the machine """ wfcMgr = WFClientMgr(server_url) self.workflowClient = wfcMgr.workflowClient self.taskClient = wfcMgr.taskClient self.thread_count = thread_count self.polling_interval = polling_interval self.worker_id = worker_id or hostname
def __init__(self, server_url, thread_count, polling_interval, worker_id=None): wfcMgr = WFClientMgr(server_url) self.workflowClient = wfcMgr.workflowClient self.taskClient = wfcMgr.taskClient self.thread_count = thread_count self.polling_interval = polling_interval self.worker_id = worker_id or hostname
def __init__(self, server_url, max_thread_count, polling_interval=0.1, worker_id=None, headers=None): # Synchronizes access to self.queues by producer thread (in read_queue) and consumer threads (in tasks_in_queue) self.lock = threading.Lock() self.queues = {} self.conductor_task_url = server_url + "/metadata/taskdefs" self.headers = headers self.consumer_worker_count = max_thread_count self.task_source = TaskSource() self.polling_interval = polling_interval wfcMgr = WFClientMgr(server_url, headers=headers) self.taskClient = wfcMgr.taskClient self.worker_id = worker_id or hostname
def __init__(self, server_url, thread_count, polling_interval): wfcMgr = WFClientMgr(server_url) self.workflowClient = wfcMgr.workflowClient self.taskClient = wfcMgr.taskClient self.thread_count = thread_count self.polling_interval = polling_interval