Is it possible to use tornado's gen.engine and gen.Task with twisted?
问题 The project I am working on is all written in Tornado, but I have included a bit of Twisted to deal with asynchronous XML-RPC. I was wondering if you can use Tornado's gen.engine and yield gen.Task with Twisted's code. Is this possible? If so how would the syntax look like? Thanks in advance. 回答1: Sure - but it's called inlineCallbacks in Twisted: from twisted.internet.defer import inlineCallbacks @inlineCallbacks def foo(): x = yield bar() print x 回答2: You can use gen.Task with anything that