Example #1
0
 def from_task_id(cls,task_id):
     if client.sismember(cls.resq_tasks,task_id):
         queue = client.get(cls.resq_queue%task_id)
         params = client.get(cls.resq_params%task_id)
         task_name = client.get(cls.resq_name%task_id)
         obj = cls(queue,params,task_name,task_id)
         return obj
     else:
         return None 
Example #2
0
 def find(cls, worker_id):
     if cls.exists(worker_id):
         queues = client.get(cls.resq_worker_queues%worker_id)
         worker = cls(queues,worker_id)
         return worker
     else:
         return None
Example #3
0
 def _get_started(self):
     datestring = client.get(self.resq_start%self)
     return datestring
Example #4
0
 def _get_end(self):
     datestring = client.get(self.resq_end % self)
     return datestring
Example #5
0
 def get(self):
     val = client.get(self.name)
     if val:
         return int(val)
     return 0
Example #6
0
 def state(self):
     stats = client.get(self.resq_worker%self.worker_id)
     if stats:
         return stats
     return None
Example #7
0
 def _get_started(self):
     datestring = client.get(self.resq_worker_start % self.worker_id)
     return datestring
Example #8
0
 def job(self):
     data = client.get(self.resq_worker_task%self.worker_id)
     if data:
         return json.loads(data)
     return {}