Why coroutines cannot be used with run_in_executor?
问题 I want to run a service that requests urls using coroutines and multithread. However I cannot pass coroutines to the workers in the executor. See the code below for a minimal example of this issue: import time import asyncio import concurrent.futures EXECUTOR = concurrent.futures.ThreadPoolExecutor(max_workers=5) async def async_request(loop): await asyncio.sleep(3) def sync_request(_): time.sleep(3) async def main(loop): futures = [loop.run_in_executor(EXECUTOR, async_request,loop) for x in