Articles Tagged tornado
Recently (26.05.2015) new tornado 4.2 was released. It contains different updates, the most valuable i suppose are modules tornado.locks and tornado.queues. They migrated from package Toro, look detailed explanation in Jesse Jiryu Davis post.
Here i want to tell about another helpful function, that was added with my help - pgettext.
It can be useful, when you are creating the translation for ambiguous strings. Let's say we have word "bat ...
Let's talk about i18n, i10n and tornado implementation. This post have a lot of text, but i wanted to describe many things that i faced during realization of i18n in tornado project. The step by step instruction is placed in the second part of this article.
i18n - shorthand from internationalization. It mean the process of multiple languages support in application. It is not the translation itself, but technical part of the ...
To set url for tornado handlers we can pass list of tuples
(url regex, handler) into application initialisation:
application = tornado.web.Application([ (r"/", MainHandler), (r"/some/path/page/(?P<pk>[0-9]+)$", PageHandler), ])
Nevertheless, in a couple of production projects that i had to work with, this wrapper wasn't used. Also in ...
But recently i need to call API from tornado application. Mentioned lib works in synchronous, i.e. blocking mode. For tornado it will be much better to use asynchronous version. Tried to search for existing solution, but can't find it. So i create my async fork, that use tornado's AsyncHTTPClient: https://github.com/st4lk/python-bitcoinrpc-tornado.
Example (print current number of blocks ...
Tornado - async web framework for python. I'll cover shortly pros and cons about tornado and introduce typical web project, that is built on top of it.
By describing pros and cons i mean my own point of view in compare with django.
In tornado core there is a infinite loop called "ioloop", that listen for events. All that happens in one single thread. For example, somebody wants to fetch /home ...