[Twisted-Python] Timing Out Deferreds

Ken Kinder ken at kenkinder.com
Fri Feb 25 14:53:30 EST 2005


I've been trying to figure out an intelligent way of timing out 
deferreds. I'd like something like this...

    def myTimeoutMethod(...):
        ...

    d = whatnot()
    d.addCallback(...)
    d.addErrback(...)
    d.addTimeout(5, myTimeoutMethod)

There are obvious problems with trying to interrupt an existing 
deferred, but I was hoping there might be just some way of discarding 
its data when it finally does return, or dereferencing the deferred 
object itself from the reactor, which might just let it clean itself up 
on its own.

Thoughts?

-Ken





More information about the Twisted-Python mailing list