def run(self): try: while True: # if there are any requests, add them to the dict. add_requests() if len(connection_dict)>0: # get the "first" request conn = pop_request() nmrequesthandler.handle_request(conn) else: # check at most twice a second (if nothing is new) time.sleep(self.sleeptime) except: servicelogger.log_last_exception() raise
def run(self): try: while True: if len(connection_dict) > 0: # get the "first" request conn = pop_request() # Removing this logging which seems excessive... # servicelogger.log('start handle_request:'+str(id(conn))) nmrequesthandler.handle_request(conn) # servicelogger.log('finish handle_request:'+str(id(conn))) else: # check at most twice a second (if nothing is new) time.sleep(self.sleeptime) except: servicelogger.log_last_exception() raise
def run(self): try: while True: if len(connection_dict)>0: # get the "first" request conn = pop_request() # Removing this logging which seems excessive... # servicelogger.log('start handle_request:'+str(id(conn))) nmrequesthandler.handle_request(conn) # servicelogger.log('finish handle_request:'+str(id(conn))) else: # check at most twice a second (if nothing is new) time.sleep(self.sleeptime) except: servicelogger.log_last_exception() raise