{ "info": { "author": "Abhinav Ajgaonkar", "author_email": "abhinav316@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "ezrpc\n=====\n\nEasy to use ZeroMQ based RPC library.\n\n.. image:: https://pypip.in/v/ezrpc/badge.png\n\t\t:target: https://pypi.python.org/pypi/ezrpc\n\n.. image:: https://pypip.in/d/ezrpc/badge.png\n\t\t:target: https://pypi.python.org/pypi/ezrpc\n\nInstall\n=======\n\n.. code-block:: text\n\n\tpip install ezrpc\n\n\nQuickstart\n==========\n\nStep 1\n------\nCreate a Server\n\n.. code-block:: python\n\n\t# server.py\n\tfrom ezrpc import Server\n\n\t# By default, the server binds to all available interfaces\n\ts = Server(server_port=5000, client_port=5001)\n\ts.start()\n\nRun this with:\n\n.. code-block:: python\n\n\tpython server.py\n\n\nStep 2\n------\nCreate a Worker\n\n.. code-block:: python\n\n\t# worker.py\n\tfrom ezrpc import Registry, ServerWorker\n\tregistry = Registry()\n\n\t@registry.method\n\tdef add(a, b):\n\t\treturn a + b\n\n\t@registry.method\n\tdef multiply(a, b):\n\t\treturn a * b\n\n\t# Point the worker to the Server's IP\n\tw = ServerWorker(sys.argv[1], registry, \"tcp://127.0.0.1:5000\")\n\tw.run()\n\nRun as many workers as your server can handle:\n\n.. code-block:: python\n\n\tpython worker.py worker1\n\tpython worker.py worker2\n\tpython worker.py worker3\n\nWorkers are elastic, i.e. you can start and stop them at will and clients will continue to be served.\n\nStep 3\n------\nCreate a Client\n\n.. code-block:: python\n\n\t# client.py\n\tfrom ezrpc import Client\n\n\t# Point the client to the Server's IP\n\t# timeout (millis) is optional, default is 5 seconds\n\tc = Client('tcp://127.0.0.1:5001', timeout=1000)\n\n\tfor i in range(1,11):\n\t\tres = c.ask('add', i, 1)\n\t\tprint 'Response: %s' % res\n\n\tc._disconnect()\n\nRun the client\n\n.. code-block:: python\n\n\tpython client.py", "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/abh1nav/ezrpc/", "keywords": null, "license": "Apache 2.0 License", "maintainer": null, "maintainer_email": null, "name": "ezrpc", "package_url": "https://pypi.org/project/ezrpc/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ezrpc/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/abh1nav/ezrpc/" }, "release_url": "https://pypi.org/project/ezrpc/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Easy to use ZeroMQ based RPC library", "version": "0.1.0" }, "last_serial": 924295, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0c44859a00aab79b77f383e64edd63c0", "sha256": "4b05d7f974578f78c1ca12017a301d54849d1874d3f3570c0b81dccf54793c8d" }, "downloads": -1, "filename": "ezrpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c44859a00aab79b77f383e64edd63c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4011, "upload_time": "2013-11-20T05:17:13", "url": "https://files.pythonhosted.org/packages/c9/b7/aa50dbf1a969670077eb7b87a54ecf778b0fb59a6277af231fd203eda8e7/ezrpc-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c44859a00aab79b77f383e64edd63c0", "sha256": "4b05d7f974578f78c1ca12017a301d54849d1874d3f3570c0b81dccf54793c8d" }, "downloads": -1, "filename": "ezrpc-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0c44859a00aab79b77f383e64edd63c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4011, "upload_time": "2013-11-20T05:17:13", "url": "https://files.pythonhosted.org/packages/c9/b7/aa50dbf1a969670077eb7b87a54ecf778b0fb59a6277af231fd203eda8e7/ezrpc-0.1.0.tar.gz" } ] }