[Twisted-Python] INCOMPATIBLE CHANGE: twisted.python.threadpool

Joshua Bartlett josh at bartletts.id.au
Sun Sep 28 19:56:04 MDT 2014


On 26 September 2014 08:31, Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:

> So, does anyone out there have any code which makes use of the
> aforementioned bad attributes of ThreadPool, whose applications would break
> if I removed them?  If so, how can I make you feel as bad about yourselves
> for using it as I feel bad about myself for writing it? ;-)
>


There are a few times in a codebase I help maintain where we want a thread
pool of all daemon threads. The code we have for this overrides
threadFactory() like so:


class DaemonThreadPool(ThreadPool):
    def threadFactory(self, *args, **kwargs):
        t = threading.Thread(*args, **kwargs)
        t.setDaemon(True)
        return t


How would I do this with your proposed new API?

Josh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20140929/44a7e1ff/attachment-0002.html>


More information about the Twisted-Python mailing list