Live data from Hacker News

Tornado 2.0 released

groups.google.com

21–30 of 34 posts

Re: Tornado 2.0 released

#21
post #19

Anyone know why they didn't go with Jinja2 for templates? When code is this clean I'm sympathetic towards the "batteries-included" approach, so I'm not criticizing the choice, just wondering if there was a back story, if it got evaluated at all. Same for locale.py vs. PyBabel. The template engine seems far better than Django's at least : )

My guess is that they wanted to go the "self-contained" route as opposed to the "amalgamation of different libraries" approach (a la Pylons/Pyramid). This makes it a lot easier to learn for true beginners since it eliminates the overhead of navigating the documentation of a multitude of different libraries .

Tornado is so flexible, though, that it would be pretty straightforward for you to use whatever templating library floats your boat.

Re: Tornado 2.0 released

#22
post #14

can not understate just how well written Tornado is. If you are a web app developer, it is well worth reading the source of the project - you will pick up a lot of tips and tricks on developing quick and scalable apps. outside of the event loop implementation, the framework components are well written - so tornado is worth checking out even if you are running on a more standard type of web server environment or appen…

I found some parts of it to be very poorly written. Like the error handling where it assumes you want to return HTML (remember that Tornado was first written to handle RSS feeds). It also has really poor support for multiprocess mode, where if a child gets killed , the parent does not restart it. Or if the parent is killed, the children may continue running. Also the gzip implementation is broken: if the client menti…

There's never been a real focus on multiprocess. The recommended solution is to run individual instances and load balance them with something like nginx and manage them with supervisord.

Sure the multiprocess stuff is in there, but I honestly wouldn't use it for more than perhaps a dev environment where you want to spool up multiple instances quickly for testing.

Re: Tornado 2.0 released

#23

What exactly is the reason for using Tornado over something like Flask+Gunicorn+meinheld? Preference?

Preference is generally the reason for choosing any framework.

What Tornado provides is a small but well featured framework for building web applications. It's event loop based which allows it to support lots of connections. It also has been built from the ground up with the idea of horizontal scaling of it across multiple load balanced instances so if that's your plan for scaling you know it fits the mold well.

Re: Tornado 2.0 released

#24

I know that nobody outside of the Python community cares, but it's disappointing to see that Tornado still doesn't use Twisted for its event handling.

You can have Tornado on Twisted, if you really want it: https://github.com/fiorix/cyclone

I have used this in a few applications and really liked it.

They've historically kept up with new Tornado releases, so hopefully they'll catch up with Tornado 2.0

Re: Tornado 2.0 released

#25
post #14

can not understate just how well written Tornado is. If you are a web app developer, it is well worth reading the source of the project - you will pick up a lot of tips and tricks on developing quick and scalable apps. outside of the event loop implementation, the framework components are well written - so tornado is worth checking out even if you are running on a more standard type of web server environment or appen…

I found some parts of it to be very poorly written. Like the error handling where it assumes you want to return HTML (remember that Tornado was first written to handle RSS feeds). It also has really poor support for multiprocess mode, where if a child gets killed , the parent does not restart it. Or if the parent is killed, the children may continue running. Also the gzip implementation is broken: if the client menti…

Like the error handling where it assumes you want to return HTML (remember that Tornado was first written to handle RSS feeds).

You can override the error handler and return whatever content type you want. Tornado was first written for an HTML site, not RSS feeds. FriendFeed supported an HTML UI before Atom and RSS feeds were added.

really poor support for multiprocess mode

The Tornado people do not recommend using multiprocess mode. They should just delete this code.

Re: Tornado 2.0 released

#26

I know that nobody outside of the Python community cares, but it's disappointing to see that Tornado still doesn't use Twisted for its event handling.

> it's disappointing to see that Tornado still doesn't use Twisted not using Twisted was the whole point of Tornado, wasn't it? If Tornado used Twisted it wouldn't exist.

[deleted]

Re: Tornado 2.0 released

#27
post #9

I know that nobody outside of the Python community cares, but it's disappointing to see that Tornado still doesn't use Twisted for its event handling.

I don't know if that many people inside the python community care either. Twisted is very big, documentation seriously lacking, and a lot of stuff in twisted not that useful if you only care about http. If you care about http, twisted is not that useful either (there is for example no http 1.1 support client-side AFAIK). It would also have made porting tornado to python 3 a huge effort (given twisted code size).

http://twistedmatrix.com/trac/browser/trunk/twisted/web/_new... I run a web crawler out of Twisted, so I sort of care about HTTP.

Re: Tornado 2.0 released

#28
post #14

can not understate just how well written Tornado is. If you are a web app developer, it is well worth reading the source of the project - you will pick up a lot of tips and tricks on developing quick and scalable apps. outside of the event loop implementation, the framework components are well written - so tornado is worth checking out even if you are running on a more standard type of web server environment or appen…

I found some parts of it to be very poorly written. Like the error handling where it assumes you want to return HTML (remember that Tornado was first written to handle RSS feeds). It also has really poor support for multiprocess mode, where if a child gets killed , the parent does not restart it. Or if the parent is killed, the children may continue running. Also the gzip implementation is broken: if the client menti…

I took the werkzeug exception handlers and wrote a small wrapper around it that would ensure the correct output type based on content

never noticed the gzip issue, since I didn't use that either

overall I think the code is very good, well written and well documented

Re: Tornado 2.0 released

#29
post #9

Earlier quoted context omitted.

I don't know if that many people inside the python community care either. Twisted is very big, documentation seriously lacking, and a lot of stuff in twisted not that useful if you only care about http. If you care about http, twisted is not that useful either (there is for example no http 1.1 support client-side AFAIK). It would also have made porting tornado to python 3 a huge effort (given twisted code size).

http://twistedmatrix.com/trac/browser/trunk/twisted/web/_new... I run a web crawler out of Twisted, so I sort of care about HTTP.

I am aware of that code: it is undocumented, and does not have support for things as fundamental as keep alive. The underscoring does not inspire confidence either.

Re: Tornado 2.0 released

#30
post #16

I know that nobody outside of the Python community cares, but it's disappointing to see that Tornado still doesn't use Twisted for its event handling.

when Tornado was first released, there was a lot of discussion online on various forums and comment threads about why it wasn't built on top of Twisted, or why it was a complete separate project. I tend to agree with Brett Taylor in that Twisted was too large a project to suit the goals of Tornado, and that its own divisions within twisted.web were difficult to navigate through the event handling part of Tornado is l…

When the original twisted code was released, I removed 1,297 lines of code to port it to twisted and gained a lot of functionality (tornado has just about no support for doing anything async). Not sure where you get less than 100 lines.

http://dustin.github.com/2009/09/12/tornado.html

Post reply on HN