Audrey M. Roy

Art, design, Python, JavaScript, and general silliness 
Filed under

tornado

 

Early thoughts about Tornado, and what I might use it for

Today I tried out Tornado, the Python non-blocking web server optimized for speed & traffic.

[Note: the confusing social media buzz around Tornado might make you think it includes social networking or twittering functionality.  That's incorrect...just setting the record straight here.]

Their chat demo seems pretty snappy, although I didn't see it under large loads or anything stressful.  The long polling stuff is super-cool.  You can start a request and leave it open for awhile, specifying a callback method to go to later.  It's like ajax inside out and backwards.

Testing out their framework...I like their blog demo.  There's a Tornado-App Engine version, which I modified slightly to create a blog to keep track of my canvas experiments (totally unrelated, just killing two birds with one stone)

Check it out: http://labs.fuzzyrainbow.com/graphicsexperiments/

[Note: if you're using Tornado with App Engine, you lose much of the functionality of Tornado that makes it interesting in the first place.  WSGI doesn't support non-blocking requests.  You'll want to use Tornado's own HTTP server.]

Tornado comes with a really simple web framework along the lines of Google App Engine's "webapp" framework.  I already like to use GAE+webapp for really simple projects, like basic API servers, and for projects where a more complex form/template system isn't useful, like very graphical games.  It doesn't have the forms fanciness of Django, but that's good sometimes.

I still have to finish writing the high scores server - the one that all the Fuzzy Rainbow mobile apps will connect to in order to send/receive high score data.  So far it's partly working on GAE+webapp (no auth yet, but I can post and get the scores from a mobile app).  I'm thinking now might be a good time to move it to Tornado. 

A game score tracking server sounds pretty trivial.  But imagine one sending and receiving updates in real-time.  You'd be able to keep tabs on your top players' while they're actually playing.  You could give them live updates on their competitors' scores. 

Not to mention you could run live tournaments and broadcast them publicly.  I didn't anticipate making anything this advanced, but Tornado would make a lot of the implementation easier.

Filed under  //   Django   Google App Engine   Python   Tornado  
Posted by email 

Comments [0]