asyncio yield from concurrent.futures.Future of an Executor
I have a long_task function which runs a heavy cpu-bound calculation and I want to make it asynchronous by using the new asyncio framework. The resulting long_task_async function uses a ProcessPoolExecutor to offload work to a different process to not be constrained by the GIL. The trouble is that for some reason the concurrent.futures.Future instance returned from ProcessPoolExecutor.submit when yielded from throws a TypeError . Is this by design? Are those futures not compatible with asyncio.Future class? What would be a workaround? I also noticed that generators are not picklable so