def launch_process(executor, callback, **kwargs):
try:
while True:
p = mp.Process(target=callback, kwargs=kwargs)
p.start()
loop = asyncio.get_event_loop()
await loop.run_in_executor(executor, wait_for, p)
except CancelledError:
pass
except KeyboardInterrupt:
pass
评论列表
文章目录