Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
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()
Пример #4
0
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()