{ "info": { "author": "Boris FELD", "author_email": "lothiraldan@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "circus\\_tornado\n===============\n\nA tornado application implementation compatible with circus sockets.\n\nAs tornado is not WSGI complient, we cannot use chaussette to run\ntornado applications with circus sockets.\n\nThis project package a compatible version of tornado Application so you\ncan easily run tornado with all circus awesomeness.\n\nUse circus\\_tornado\n===================\n\nLet's take a simple example, the hello world::\n\n import tornado.ioloop\n import tornado.web\n\n from tornado.web import Application\n\n class MainHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"Hello, world\")\n\n application = Application([\n (r\"/\", MainHandler),\n ])\n\n if __name__ == \"__main__\":\n application.listen(8888)\n tornado.ioloop.IOLoop.instance().start()\n\nIf you want to run it with circus, you can't use socket web and fallback\nto launch them and let it bind its socket::\n\n [watcher:hello]\n cmd = python hello_world.py\n\nBut good news, with circus\\_tornado, it's no longer true. Just import\nApplication from circus\\_tornado package::\n\n import tornado.ioloop\n import tornado.web\n\n from tornado_circus import Application\n\n class MainHandler(tornado.web.RequestHandler):\n def get(self):\n self.write(\"Hello, world\")\n\n application = Application([\n (r\"/\", MainHandler),\n ])\n\n if __name__ == \"__main__\":\n parse_command_line()\n application.listen(8888)\n tornado.ioloop.IOLoop.instance().start()\n\nOne last requirement, you must call tornado.options.parse\\_command\\_line\n**before** calling application.listen or it will doesn't works.\n\nAnd finally the circus configuration::\n\n [watcher:hello]\n cmd = python hello_world.py --fd=$(circus.sockets.hello)\n use_sockets = True\n\n [socket:hello]\n host = 127.0.0.1\n port = 9000\n\nAnd you're done. You can go to http://localhost:9000 to check if it\nworks.\n\nYou can even launch a quick benchmark and check that it holds the load::\n\n $> boom -n 10000 -c 100 http://localhost:9000 10:38:48\n Server Software: TornadoServer/2.4.1\n Running GET http://127.0.0.1:9000\n Host: localhost\n Running 10000 times per 100 workers.\n Starting the load [===...===] Done\n\n -------- Errors --------\n\n -------- Results --------\n Successful calls 10000\n Total time 9.3364 s\n Average 0.0656 s\n Fastest 0.0228 s\n Slowest 0.1009 s\n Amplitude 0.0781 s\n RPS 1071\n BSI Woooooo Fast\n\n -------- Status codes --------\n Code 200 10000 times.\n\n -------- Legend --------\n RPS: Request Per Second\n BSI: Boom Speed Index", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Lothiraldan/tornado_circus", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "tornado_circus", "package_url": "https://pypi.org/project/tornado_circus/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tornado_circus/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Lothiraldan/tornado_circus" }, "release_url": "https://pypi.org/project/tornado_circus/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A tornado application compatible with circus socket", "version": "0.0.1" }, "last_serial": 822057, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "5457cd3bbecd4d4b68ddcf00ea361039", "sha256": "5c67041f6361ceba9ff009921717ca1c688ca5fa7a9bf96bd1788dd70cab50df" }, "downloads": -1, "filename": "tornado_circus-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5457cd3bbecd4d4b68ddcf00ea361039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1147, "upload_time": "2013-07-22T11:47:17", "url": "https://files.pythonhosted.org/packages/7d/24/a5aee6c22201687ebdad36ffd19dc62a8daaffae438a692cf9ae4c01023d/tornado_circus-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5457cd3bbecd4d4b68ddcf00ea361039", "sha256": "5c67041f6361ceba9ff009921717ca1c688ca5fa7a9bf96bd1788dd70cab50df" }, "downloads": -1, "filename": "tornado_circus-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5457cd3bbecd4d4b68ddcf00ea361039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1147, "upload_time": "2013-07-22T11:47:17", "url": "https://files.pythonhosted.org/packages/7d/24/a5aee6c22201687ebdad36ffd19dc62a8daaffae438a692cf9ae4c01023d/tornado_circus-0.0.1.tar.gz" } ] }