[Twisted-Python] thread pool question

Rutt, Benjamin Benjamin.Rutt at gs.com
Thu Mar 22 15:35:19 EDT 2007


Thanks but that runs forever for me too (twisted 2.0.0).

Does this stop for you?

#!/usr/bin/env python
from twisted.internet import reactor
from twisted.internet import threads

def aSillyBlockingMethod(x):
    import time
    time.sleep(2)
    print x

d = threads.deferToThread(aSillyBlockingMethod, "2 seconds have passed")
d.addBoth(reactor.stop)




More information about the Twisted-Python mailing list