4 ms·
glad to know tornado is creating its own twisted impl.
by tuna 14y ago
glad to know tornado is creating its own twisted impl.
- majke 14y agoTwisted has a similar heavy weight machinery to support generator "coroutines" :)
- eurleif 14y agoHeavy weight? It's under 40 lines of code. (The inlineCallbacks function here: http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.1.0/twisted/internet/defer.py http://twistedmatrix.com/trac/browser/tags/releases/twisted-...)
- majke 14y ago"inlineCallbacks" is 3 lines long. "_inlineCallbacks" is around 50 lines long :) Let's not get into discussion if tornado is better or not than twisted. Both have similar mechanism to flatten generators and both mechanisms are much more complex than one could expect. Also, both of them heavily depend on python exception handling. BTW, this is brilliant: # This function is complicated by the need to prevent unbounded recursion # arising from repeatedly yielding immediately ready deferreds. This while # loop and the waiting variable solve that by manually unfolding the # recursion.