“It should be easy for (Python 3.3 ports of) frameworks like Twisted, Tornado, or even gevent to either adapt the default event loop implementation to their needs using a lightweight adapter or proxy, or to replace the default event loop implementation with an adaptation of their own event loop implementation.” “Interoperability - asyncio” https://www.python.org/dev/peps/pep-3156/
“For this interoperability to be effective, the preferred direction of adaptation in third party frameworks is to keep the default event loop and adapt it to the framework's API. Ideally all third party frameworks would give up their own event loop implementation in favor of the standard implementation.” “Interoperability - asyncio” https://www.python.org/dev/peps/pep-3156/
cooperative, single-threaded multitasking primitives for supporting asynchronous programming (Futures are like Deferreds, coroutines are like inlineCallbacks)
“Twisted is an async I/O thing, asyncio is an async I/O thing. Therefore they are the same kind of thing. I only need one kind of thing in each category of thing. Therefore I only need one of them, and the “standard” one is probably the better one to depend on. So I guess nobody will need Twisted any more!” https://glyph.twistedmatrix.com/2014/05/the-report-of-our-death.html
Similar to yield from, delegates to subgenerator Asynchronous code executed in a synchronous style Yielding for other things while it waits for a new result
@inlineCallbacks def loadData(url): response = yield makeRequest(url) return json.loads(response) Twisted has had a trampoline to turn Deferreds into a generator since 2006
Example: Autobahn|Python Websockets for Twisted and asyncio WS + WAMP, a RPC & PubSub framework Super fast under PyPy! I work on it :D github.com/crossbario/autobahnpython