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()