{ "info": { "author": "Yoki", "author_email": "ispeedly@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "ToRPC\r\n=====\r\n\r\nToRPC(Tornado + RPC) is a tiny tcp and duplex RPC implementation in\r\nPython based on Tornado IOLoop. It\u2019s very lightweight and high\r\nperformance(especially on PyPy).\r\n\r\nNotice: ToRPC was only tested on ``CPython 2.7+`` and ``PyPy 2.5+``\r\nuntil now.\r\n\r\n## Examples\r\n-----------\r\n\r\nRPC server\r\n~~~~~~~~~~\r\n\r\n.. code:: python\r\n\r\n from tornado import ioloop\r\n from torpc import RPCServer\r\n server = RPCServer(('127.0.0.1', 5000))\r\n\r\n @server.service.register()\r\n def echo(x):\r\n return x\r\n\r\n server.start()\r\n ioloop.IOLoop.instance().start()\r\n\r\nRPC client\r\n~~~~~~~~~~\r\n\r\n.. code:: python\r\n\r\n from tornado import ioloop, gen\r\n from torpc import RPCClient\r\n\r\n def result_callback(f):\r\n print(f.result())\r\n\r\n @gen.coroutine\r\n def using_gen_style():\r\n want_to_say = 'way to explore'\r\n ret = yield rc.call('echo', want_to_say)\r\n assert ret == want_to_say\r\n print('gen_style complete')\r\n\r\n rc = RPCClient(('127.0.0.1', 5000))\r\n rc.call('echo', 'hello world', callback=result_callback)\r\n future = rc.call('echo', 'code for fun')\r\n future.add_done_callback(result_callback)\r\n using_gen_style()\r\n ioloop.IOLoop.instance().start()\r\n\r\nSee more in `examples`_.\r\n\r\nPerformance\r\n~~~~~~~~~~~\r\n\r\nOS: CentOS 6.6 x64\r\nCPU: Intel i5-3470 3.20GHz\r\nMemory: 8 GB 1600 MHz DDR3\r\nPython: 2.7.10\r\nPyPy: 4.0.0\r\n\r\n+----------------------+---------------------+---------------+\r\n| environment | call coroutine(qps) | callback(qps) |\r\n+======================+=====================+===============+\r\n| Python(with timeout) | 9842 | 11614 |\r\n+----------------------+---------------------+---------------+\r\n| Python | 13192 | 16638 |\r\n+----------------------+---------------------+---------------+\r\n| PyPy(with timeout) | 40486 | 41225 |\r\n+----------------------+---------------------+---------------+\r\n| PyPy | 53252 | 59151 |\r\n+----------------------+---------------------+---------------+\r\n| PyPy(unix domain) | 67100 | 74362 |\r\n+----------------------+---------------------+---------------+\r\n\r\nIn this benchmark, Python loops 100k times and PyPy loops 1000k times,\r\nthen run 3 times of each, the result is on `gist:benchmark\\_result.txt`_\r\n\r\nDocument\r\n~~~~~~~~\r\n\r\n`\u4e2d\u6587`_\r\n\r\n.. _examples: https://github.com/yoki123/torpc/tree/master/examples\r\n.. _`gist:benchmark\\_result.txt`: https://gist.github.com/yoki123/c6f8a9c4f375f61359e2\r\n.. _\u4e2d\u6587: https://github.com/yoki123/torpc/blob/master/README-zh.rst", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/yoki123/torpc", "keywords": "tornado,rpc,async", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "torpc", "package_url": "https://pypi.org/project/torpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/torpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/yoki123/torpc" }, "release_url": "https://pypi.org/project/torpc/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A tiny async tcp and duplex rpc implementation using Tornado IOLoop.", "version": "0.0.1" }, "last_serial": 1815962, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "18f9fa7934ecae63417308328845a0b4", "sha256": "0fbb98aaa35fe3d7f557c59ffd9cac1a2b504c3e83a29280d9041fa5c7cd9c01" }, "downloads": -1, "filename": "torpc-0.0.1.tar.gz", "has_sig": false, "md5_digest": "18f9fa7934ecae63417308328845a0b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6646, "upload_time": "2015-11-14T06:00:38", "url": "https://files.pythonhosted.org/packages/45/c6/9fdb3d1344593beb10718204cde0f708ebdda0ee9c3bf329a111a4699c7b/torpc-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18f9fa7934ecae63417308328845a0b4", "sha256": "0fbb98aaa35fe3d7f557c59ffd9cac1a2b504c3e83a29280d9041fa5c7cd9c01" }, "downloads": -1, "filename": "torpc-0.0.1.tar.gz", "has_sig": false, "md5_digest": "18f9fa7934ecae63417308328845a0b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6646, "upload_time": "2015-11-14T06:00:38", "url": "https://files.pythonhosted.org/packages/45/c6/9fdb3d1344593beb10718204cde0f708ebdda0ee9c3bf329a111a4699c7b/torpc-0.0.1.tar.gz" } ] }