def move_tasks(kz): base_path = config['cache']['manager']['lock_path_prefix'] for path in kz.get_children(base_path + '/entries'): item = kz.get('{}/entries/{}'.format(base_path, path))[0] if not item: continue task = msgpack.unpackb(item) q = LockingQueue(kz, base_path, task['group']) q.put(item)
def move_tasks(kz): base_path = config['cache']['manager']['lock_path_prefix'] for path in kz.get_children(base_path + '/entries'): item = kz.get('{}/entries/{}'.format( base_path, path))[0] if not item: continue task = msgpack.unpackb(item) q = LockingQueue(kz, base_path, task['group']) q.put(item)
def put_task(self, task): group_id = task['group'] q = LockingQueue(self.client, self.lock_path_prefix, group_id) return q.put(self._serialize(task))