def execRequest (req, url):
global results
workers = []
tree = req['tree']
for child in tree['controller']['child']:
t = Thread (target = wrapper, args = (httpcmd, (child, req, url),
results))
workers.append (t)
for worker in workers:
worker.start()
for worker in workers:
worker.join()
data = []
for res in results:
resp, content = res
if resp['status'] == '200':
data += json.loads (content, object_hook=json_util.object_hook)
results = []
return json.dumps (data, default=json_util.default)
评论列表
文章目录