Nathaniel Smith <[email protected]> added the comment:
It might be possible to create ProcessPoolExecutor and get it to spawn all the
workers *before* you start the asyncio loop. It looks like ProcessPoolExecutor
delays spawning workers until the first piece of work is submitted, but at that
point it spawns all of them immediately, so something like this might work:
executor = ProcessPoolExecutor(...)
executor.submit(lambda: None).wait()
with asyncio.get_event_loop() as loop:
loop.run_until_complete(...)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31489>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com