views:

46

answers:

1

I'm trying to adapt some tornado code to work with twisted.

Tornado's IOLoop has a function (add_callback) that will essentially call the function back in the next iteration of the loop. As far as I can tell, twisted doesn't have a direct translation of this. Is there any way to simulate this in twisted?

+4  A: 

reactor.callLater(0, x) or reactor.callFromThread(x)

Jason Scheirer
Also known as <http://twistedmatrix.com/documents/10.1.0/api/twisted.internet.interfaces.IReactorTime.callLater.html> and <http://twistedmatrix.com/documents/10.1.0/api/twisted.internet.interfaces.IReactorThreads.callFromThread.html>.
Glyph