File: intro.rst

package info (click to toggle)
python-tornado 4.4.3-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 3,028 kB
  • sloc: python: 25,036; sh: 130; xml: 49; ansic: 45; makefile: 45; sql: 26
file content (31 lines) | stat: -rw-r--r-- 1,616 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Introduction
------------

`Tornado <http://www.tornadoweb.org>`_ is a Python web framework and
asynchronous networking library, originally developed at `FriendFeed
<http://friendfeed.com>`_.  By using non-blocking network I/O, Tornado
can scale to tens of thousands of open connections, making it ideal for
`long polling <http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_,
`WebSockets <http://en.wikipedia.org/wiki/WebSocket>`_, and other
applications that require a long-lived connection to each user.

Tornado can be roughly divided into four major components:

* A web framework (including `.RequestHandler` which is subclassed to
  create web applications, and various supporting classes).
* Client- and server-side implementions of HTTP (`.HTTPServer` and
  `.AsyncHTTPClient`).
* An asynchronous networking library including the classes `.IOLoop`
  and `.IOStream`, which serve as the building blocks for the HTTP
  components and can also be used to implement other protocols.
* A coroutine library (`tornado.gen`) which allows asynchronous
  code to be written in a more straightforward way than chaining
  callbacks.

The Tornado web framework and HTTP server together offer a full-stack
alternative to `WSGI <http://www.python.org/dev/peps/pep-3333/>`_.
While it is possible to use the Tornado web framework in a WSGI
container (`.WSGIAdapter`), or use the Tornado HTTP server as a
container for other WSGI frameworks (`.WSGIContainer`), each of these
combinations has limitations and to take full advantage of Tornado you
will need to use the Tornado's web framework and HTTP server together.