Unlike other mainstream Web server frameworks (primarily the Python framework), Tornado uses Epoll non-blocking io, which responds quickly, handles thousands of concurrent connections, and is especially useful for real-time web services.
High Performance Web server framework Tornado simple implementation restful interface and development instance http://www.jb51.net/article/52209.htm
To use it, you must follow these kits:
1 python (Recommended use of Python 2.5/python 2.6)
2) Simplejson (recommended to use Simplejson 2.0.9)
3) CURL (recommended to use CURL 7.19.7 or above)
4) Pycurl (recommended to use Pycurl 7.16.2.1)
5 Tornado Web Server (This is the protagonist, version of the latest installation of the official online bar)
One of the simplest services:
Import tornado.ioloop
import Tornado.web
class MainHandler (Tornado.web.RequestHandler):
def get (self):
self.write ("Hello, World")
application = Tornado.web.Application ([
(R "/", MainHandler),
])
if __name__ = = "__main__":
application.listen (8888)
tornado.ioloop.IOLoop.instance (). Start ()