Пример #1
0
def _sync(task):
    task_queue = Queue()
    result_queue = Queue()
    task = signing.SignedPackage.loads(pack)
    task_queue.put(task)
    task_queue.put('STOP')
    cluster.worker(task_queue, result_queue, Value('f', -1))
    result_queue.put('STOP')
    cluster.monitor(result_queue)
    return True, task['id']
Пример #2
0
def _sync(pack):
    """Simulate a package travelling through the cluster."""
    task_queue = Queue()
    result_queue = Queue()
    task = signing.SignedPackage.loads(pack)
    task_queue.put(task)
    task_queue.put('STOP')
    cluster.worker(task_queue, result_queue, Value('f', -1))
    result_queue.put('STOP')
    cluster.monitor(result_queue)
    return task['id']
Пример #3
0
def _sync(task_id, pack):
    """
    Simulates a package travelling through the cluster.

    """
    task_queue = Queue()
    result_queue = Queue()
    task_queue.put(pack)
    task_queue.put('STOP')
    cluster.worker(task_queue, result_queue, Value('b', -1))
    result_queue.put('STOP')
    cluster.monitor(result_queue)
    return task_id