Kyle Stanley <aeros...@gmail.com> added the comment:

> The asynchronous spawning of threads or processes would also not be 
> compatible with the executor subclasses as far as I can tell.

> Thus, it seemed to make more sense to me to actually build up a new Pool 
> class from scratch that was largely based on Executor, but with significantly 
> differing functionality. Otherwise, it seems like we would have to make some 
> modifications to ThreadPoolExecutor, or inherit from it and then redesign the 
> internals of some of the methods to change the way the threads/processes are 
> spawned. 

I'm going to have to rescind the above statements. I was able to implement a 
new prototype of asyncio.ThreadPool (using ThreadPoolExecutor) that spawns it's 
threads asynchronously on startup. Since this one a bit more involved than the 
previous code examples, I created a gist: 
https://gist.github.com/aeros/8a86de6b13f17b9f717ea539ee1ee78f

It's by no means a complete implementation, but it at least proves the 
functionality that Yury described is very much possible using the existing 
ThreadPoolExecutor class.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32309>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to