Oscar Vilaplana: Tornado in depth

published May 11, 2012

Oscar Vilaplana talks about Tornado at PyGrunn.

See the PyGrunn website for more info about this one-day Python conference in Groningen, The Netherlands.

You can use tornado for web sockets, streaming, etc. It is a non-blocking web server. You can handle thousands of connections. We is it at PayLogic for something secret.

Three concepts: callback, timeout, event. A callback is something that you want to retun to later. An event is something that happens in a socket. When an event happens, a handler is called. When nothing happens there is a timeout and at the latest then we run the callbacks again. This is all done during an IOLoop.

Handling a web request is coded as some callbacks.

You can keep state around in the code, sharable over all request, so you have less things that you need to build up at the start of a request and have to tear down at the end. This makes it fast.

Push notifications can be done this way.

Audience: Tornado is between Twisted and Django.