{ "info": { "author": "Roberto Forlani", "author_email": "roberto.forlani@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# PyAsynch\n\nPyAsynch is a package to create distributed Python Services through RabbitMQ.\n\nThe services talk each other through a common RabbitMQ queue and expose the service also as HTTP Tornado Server\n\n## How to use it\n\n```\npip install pyasynch\n```\nor \n```\npip3 install pyasynch\n```\n\nor just clone the git repo.\n\nCreate your custom node\n```\n\nfrom pyasynch.node import Node\n\nclass MyNode(Node):\n\n def mymethod(self,arg1,arg2,**kwargs):\n return {'myproperty':'myvalue'}\n\n def mysecondmethod(self,myproperty,**kwargs):\n return {} \n\n```\n\nCreate the configuration file (e.g. myconfig.json)\n\n```\n{\n \"endpoint\": {\n \"amqp\": \"amqp://guest:guest@127.0.0.1:5672/pyasynch\",\n \"id\": \"myendpoint\",\n \"threaded\": false\n }\n}\n```\n\nCreate the routing file (e.g. myroutes.json)\n\n```\n{\n \"routes\": {\n \"pyasynch://myendpoint/mynode/mymethod\" : [\"pyasynch://myendpoint/mynode/mysecondmethod\"],\n} \n```\n\nCreate the main (e.g. main.py) runner and register the node\n\n```\n# IMPORTS\nfrom pyasynch.environment import Environment\n\nenv = Environment()\nenv.register_node('mynode',MyNode(env.endpoint))\n\ntry:\n env.run()\nexcept KeyboardInterrupt:\n env.stop()\n\n```\n\nEverything is ready, now you can run the endpoint service (check if RabbitMQ is running properly)\n\npython3 main.py -c myconfig.json -r myroutes.json -p 8081\n\nYou can replicate nodes and endpoint logic in a scalable way.\n\nYou can then perform JSON get or POST to the endpoint:\nhttp://127.0.0.1:8081/mynode/mymethod\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hoploop/pyasynch", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "PyAsynch", "package_url": "https://pypi.org/project/PyAsynch/", "platform": "", "project_url": "https://pypi.org/project/PyAsynch/", "project_urls": { "Homepage": "https://github.com/hoploop/pyasynch" }, "release_url": "https://pypi.org/project/PyAsynch/1.2.2/", "requires_dist": [ "pika", "python-dateutil", "tornado" ], "requires_python": "", "summary": "Python asynch distributed and scalable Queue Services", "version": "1.2.2" }, "last_serial": 4853938, "releases": { "1.2.2": [ { "comment_text": "", "digests": { "md5": "6d0e7817a17fdd8f68cc35f8fb45653a", "sha256": "1584ae5568172b67dd400e48d55967bd94b9736ea5ffaf3d658748ee439dfbb5" }, "downloads": -1, "filename": "PyAsynch-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6d0e7817a17fdd8f68cc35f8fb45653a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12938, "upload_time": "2019-02-22T10:31:41", "url": "https://files.pythonhosted.org/packages/45/18/3948bea58c1c5936da5d77e24c820c629b7531ff7d2f7321046248a58454/PyAsynch-1.2.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6d0e7817a17fdd8f68cc35f8fb45653a", "sha256": "1584ae5568172b67dd400e48d55967bd94b9736ea5ffaf3d658748ee439dfbb5" }, "downloads": -1, "filename": "PyAsynch-1.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6d0e7817a17fdd8f68cc35f8fb45653a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12938, "upload_time": "2019-02-22T10:31:41", "url": "https://files.pythonhosted.org/packages/45/18/3948bea58c1c5936da5d77e24c820c629b7531ff7d2f7321046248a58454/PyAsynch-1.2.2-py3-none-any.whl" } ] }