예제 #1
0
 def run(self):
     while True:
         self.idl.wait(self.poller)
         self.poller.fd_wait(self.txns.alert_fileno, poller.POLLIN)
         self.poller.block()
         self.idl.run()
         txn = self.txns.get_nowait()
         if txn is not None:
             try:
                 txn.results.put(txn.do_commit())
             except Exception as ex:
                 er = idlutils.ExceptionResult(ex=ex,
                                               tb=traceback.format_exc())
                 txn.results.put(er)
             self.txns.task_done()
예제 #2
0
 def run(self):
     while True:
         self.idl.wait(self.poller)
         self.poller.fd_wait(self.txns.alert_fileno, poller.POLLIN)
         #TODO(jlibosva): Remove next line once losing connection to ovsdb
         #                is solved.
         self.poller.timer_wait(self.timeout * 1000)
         self.poller.block()
         self.idl.run()
         txn = self.txns.get_nowait()
         if txn is not None:
             try:
                 txn.results.put(txn.do_commit())
             except Exception as ex:
                 er = idlutils.ExceptionResult(ex=ex,
                                               tb=traceback.format_exc())
                 txn.results.put(er)
             self.txns.task_done()