def handle_requests(wait_time = None, callback = None):
global abort
abort = false
if pyro_daemon is None:
raise Pyro.errors.PyroError("There is no daemon with which to handle requests")
return
if wait_time:
start = time.time()
while not abort:
try:
pyro_daemon.handleRequests(wait_time)
if wait_time:
now = time.time()
if callback and now - start > wait_time:
callback()
start = now
elif callback:
callback()
except Exception, msg:
if verbose:
print "Error:", sys.exc_type, msg
abort = true
except:
abort = true
return abort
评论列表
文章目录