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