Exemple #1
0
 def run(self,content):
     #check params
     
     #write info into local sqlite
     obj = ProcessAgentTask()
     
     #return task info 
     return obj.run(content)
 def run(self):
     
     while not self._stopevent.is_set():
         self._cond.acquire()
         while self._queue.empty():
             self._cond.wait()
         fetch_data = self._queue.get()
         #process data
         #update task status
         self._cond.release()
         #obj = self._class_obj()
         obj = ProcessAgentTask()
         ret_result = obj.run(fetch_data)
         #add callback result
         log(str(ret_result))
         #self._callback_obj.run(ret_result)
         #time.sleep
         sleep_interval = random.randint(0,10)
         time.sleep(sleep_interval)