[Twisted-Python] which async framework?

Tobias Oberstein tobias.oberstein at tavendo.de
Wed Mar 12 06:59:42 MDT 2014


>  From my side, I'm looking to experimentally build a network testing tool that
> will need to speak a fair few protocols, both classic tcp and multicast-based,

Tornado is a _Web_ framework. A requirement for UDP, and multicast UDP, narrows
suitable choices to Twisted and asyncio.

Twisted is around much longer, and also has a broader focus .. lots of protocols implemented
on top of TCP/IP.

Asyncio is opiniated towards a co-routine based style. Twisted probably more towards
"classical" Deferred based style, though you can go co-routine style as well.

> and have a web api living on top of it that most likely will have a websocket
> for pumping data to the browser. It'll also need to write out JUnit-compatible

If you need WebSocket anyway, you can directly compare Twisted and asyncio programming
with these examples:

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo
https://github.com/tavendo/AutobahnPython/tree/master/examples/asyncio/websocket/echo

Disclaimer: I am affiliated with that stuff.

> I'd like to be able to serve the rest of the web api using a pyramid wsgi app if

Twisted can act as a WSGI host, and that can be combined with WebSocket also (in one server,
and both services running on one port).

/Tobias




More information about the Twisted-Python mailing list