def safe_call(self, func, apply_max_time, body):
# os.setpgrp() # kill non propagate
if 'gevent' not in sys.modules:
return_dict = Manager().dict()
p = Process(target=self.safe_worker, args=(func, return_dict,
apply_max_time, body))
p.start()
p.join()
else:
return_dict = {}
self.safe_worker(func, return_dict, apply_max_time, body)
return return_dict
评论列表
文章目录