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']
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']
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