예제 #1
0
 def count_waiting_jobs(cls, name):
     """
     Return the number of all jobs waiting in queues with the given name
     """
     collection = cls.collection(name=name).sort(by='-priority')
     return sum([col.waiting.llen() for col in collection.instances()])
예제 #2
0
 def get_keys(cls, name):
     """
     Return a list of all queue keys, to use with blpop
     """
     collection = cls.collection(name=name).sort(by='-priority')
     return [col.waiting.key for col in collection.instances()]