def start_worker(): """ Setup the worker and start it. """ queue = getQueue() vtable = { 'status_update': update_job_status_task, 'echo': echo_task, 'create_competition': create_competition_task, 'evaluate_submission': evaluate_submission_task, 'run_update': update_submission_task } worker = BaseWorker(queue, vtable, logger) logger.info("Starting site worker.") worker.start()
def main(): """ Setup the worker and start it. """ config = WorkerConfig() logging.config.dictConfig(config.getLoggerDictConfig()) # queue to listen to for notifications of tasks to perform queue = AzureServiceBusQueue(config.getAzureServiceBusNamespace(), config.getAzureServiceBusKey(), config.getAzureServiceBusIssuer(), config.getAzureServiceBusQueue()) # map task type to function to accomplish the task vtable = {'run': get_run_func(config)} # create and start the worker worker = BaseWorker(queue, vtable, logger) logger.info("Starting compute worker.") worker.start()
def main(): """ Setup the worker and start it. """ config = WorkerConfig() logging.config.dictConfig(config.getLoggerDictConfig()) # queue to listen to for notifications of tasks to perform queue = AzureServiceBusQueue(config.getAzureServiceBusNamespace(), config.getAzureServiceBusKey(), config.getAzureServiceBusIssuer(), config.getAzureServiceBusQueue()) # map task type to function to accomplish the task vtable = { 'run' : get_run_func(config) } # create and start the worker worker = BaseWorker(queue, vtable, logger) logger.info("Starting compute worker.") worker.start()