run_on_executor 本身就设置了线程最大数 run_in_executor 设置默认线程池 exe = ThreadPoolExecutor(2) asyncio.get_event_loop().set_default_executor(exe) 即可~ 在idea的debug测试 完美! 来源:https://my.oschina.net/zhenruyan/blog/3097270 标签 asyncio python IntelliJ IDEA