On 12 March 2014 07:28, Chris Withers <ch...@simplistix.co.uk> wrote: > > > So, I see python now has a plethora of async frameworks and I need to try > and pick one to use from: > > - asyncio/tulip > - tornado > - twisted > > 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, 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 xml results, but that's like the easiest bit ;-) > > I'd like to be able to serve the rest of the web api using a pyramid wsgi > app if possible, and I'd like to be able to write the things that process > requests in and validation out in a synchronous fashion, most likely > spinning off a thread for each one. >
Tornado is a web-framework, if you are going to use pyramid for handling wsgi requests asyncio or twisted are probably a better solution. They can handle your synchronous wsgi responses via the event loop executor (a thread pool). > > The protocols are all financial (do we really not have a pure-python FIX > library?!) but none are likely to have existing python implementations. > Both asyncio and twisted offer an extensive, somehow similar, API for writing protocols, TCP and UDP. > How should I pick between the options? What would people recommend and why? > > If you are using python 3.3 I would strongly recommend asyncio, it has a clean and unintrusive API and, importantly, it is part of the standard library (in python 3.4). If you are using python 2 I would still recommend it, the trollius project has backported the library (although there are some important differences). Pulsar, is a server side library I maintain which is now fully based on asyncio, works on python 3 & 2, and does more or less what you are looking for. Of course, twisted is more tested and has a longer history, but if you are forward looking asyncio might be a better bet.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python