{ "info": { "author": "Dmitry Orlov ", "author_email": "me@mosquito.su", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Programming Language :: Python" ], "description": "WSRPC Tornado\n=============\n\n.. image:: https://travis-ci.org/mosquito/wsrpc.svg\n :target: https://travis-ci.org/mosquito/wsrpc\n\nRemote Procedure call through WebSocket between browser and tornado.\n\nFeatures\n--------\n\n* Initiating call client function from server side.\n* Calling the server method from the client.\n* Transferring any exceptions from a client side to the server side and vise versa.\n* The frontend-library are well done for usage without any modification.\n* Fully asynchronous server-side functions.\n* Thread-based websocket handler for writing fully-synchronous code (for synchronous database drivers etc.)\n* Protected server-side methods (starts with underline never will be call from clients-side directly)\n* Asynchronous connection protocol. Server or client can call multiple methods with unpredictable ordering of answers.\n\n\nInstallation\n------------\n\nInstall via pip::\n\n pip install wsrpc-tornado\n\n\nInstall ujson if you want::\n\n pip install ujson\n\n\n\nSimple usage\n------------\n\nAdd the backend side\n\n\n.. code-block:: python\n\n from time import time\n ## If you want write async tornado code import it\n # from from wsrpc import WebSocketRoute, WebSocket, wsrpc_static\n ## else you should use thread-base handler\n from wsrpc import WebSocketRoute, WebSocketThreaded as WebSocket, wsrpc_static\n\n tornado.web.Application((\n # js static files will available as \"/js/wsrpc.min.js\".\n wsrpc_static(r'/js/(.*)'),\n # WebSocket handler. Client will connect here.\n (r\"/ws/\", WebSocket),\n # Serve other static files\n (r'/(.*)', tornado.web.StaticFileHandler, {\n 'path': os.path.join(project_root, 'static'),\n 'default_filename': 'index.html'\n }),\n ))\n\n # This class should be call by client.\n # Connection object will be have the instance of this class when will call route-alias.\n class TestRoute(WebSocketRoute):\n # This method will be executed when client will call route-alias first time.\n def init(self, **kwargs):\n # the python __init__ must be return \"self\". This method might return anything.\n return kwargs\n\n def getEpoch(self):\n # this method named by camelCase because the client can call it.\n return time()\n\n # stateful request\n # this is the route alias TestRoute as \"test1\"\n WebSocket.ROUTES['test1'] = TestRoute\n\n # stateless request\n WebSocket.ROUTES['test2'] = lambda *a, **kw: True\n\n # initialize ThreadPool. Needed when using WebSocketThreaded.\n WebSocket.init_pool()\n\n\n\nAdd the frontend side\n\n\n.. code-block:: HTML\n\n \n \n \n\n\n\nExample\n+++++++\n\nExample running there demo_.\n\n\n.. _demo: http://wsrpc.mosquito.su/", "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/aiohttp_wsrpc/aiohttp_wsrpc-tornado", "keywords": null, "license": "LGPLv3", "maintainer": null, "maintainer_email": null, "name": "aiohttp-wsrpc", "package_url": "https://pypi.org/project/aiohttp-wsrpc/", "platform": "all", "project_url": "https://pypi.org/project/aiohttp-wsrpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/aiohttp_wsrpc/aiohttp_wsrpc-tornado" }, "release_url": "https://pypi.org/project/aiohttp-wsrpc/0.5.3/", "requires_dist": null, "requires_python": null, "summary": "WSRPC WebSocket RPC for tornado", "version": "0.5.3" }, "last_serial": 2323401, "releases": { "0.5.3": [] }, "urls": [] }