[Twisted-Python] Twisted Advice

Jean-Paul Calderone exarkun at divmod.com
Thu Apr 17 05:27:40 MDT 2008


On Thu, 17 Apr 2008 12:04:13 +0100, Paul Wilson <paulalexwilson at gmail.com> wrote:
> [snip]
>
>Ahh. Okay; thanks for this. deferToThread looks like a good option
>here and seems to fit what I'm looking for. From experience, can you
>point me towards some good code that uses deferToThread?

Here's some:

http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.0.1/twisted/internet/base.py#L195

It's somewhat complicated by the addition of timeout support on top of an
API which doesn't support timeouts, but it's one of only two uses of the
API in Twisted and I think the other is even more confusing. :)

Jean-Paul





More information about the Twisted-Python mailing list