{ "info": { "author": "Jesse Pollak", "author_email": "jesse@getclef.com", "bugtrack_url": null, "classifiers": [], "description": "# flask_nameko\n\nA wrapper for using nameko services with Flask\n\n## Installation\n\nInstall it via PyPI:\n\n pip install flask_nameko\n\n## Usage\n\nTo start using `flask_nameko`, you need to create and configure a new `FlaskPooledClusterRpcProxy` singleton, which you'll use to communicate with your Nameko cluster.\n\n # __init__.py\n from flask import Flask\n from flask_nameko import FlaskPooledClusterRpcProxy\n\n rpc = FlaskPooledClusterRpcProxy()\n\n def create_app():\n app = Flask(__name__)\n app.config.update(dict(\n NAMEKO_AMQP_URI='amqp://localhost'\n ))\n\n rpc.init_app(app)\n\n app = create_app()\n\nThen, you can use the `FlaskPooledClusterRpcProxy` singleton just as you would normally use a `ClusterRpcProxy`, by accessing individual services by name and calling methods on them:\n\n # routes.py\n\n from . import (\n app,\n rpc\n )\n\n @app.route('/'):\n def index():\n result = rpc.service.do_something('test')\n return result\n\n## API\n\n### Configuration\n\n`FlaskPooledClusterRpcProxy` accepts all nameko configuration values, prefixed with the `NAMEKO_` prefix. In addition, it exposes additional configuration options:\n\n* `NAMEKO_INITIAL_CONNECTIONS (int, default=2)` - the number of initial connections to the Nameko cluster to create\n* `NAMEKO_MAX_CONNECTIONS (int, default=8)` - the max number of connections to the Nameko cluster to create before raises an error\n* `NAMEKO_CONNECT_ON_METHOD_CALL (bool, default=True)` - whether connections to services should be loaded when the service is accessed (False) or when a method is called on a service (True)\n* `NAMEKO_RPC_TIMEOUT` (int, default=None) - the default timeout before raising an error when trying to call a service RPC method\n* `NAMEKO_POOL_RECYCLE` (int, default=None) - if specified, connections that are older than this interval, specified in seconds, will be automatically recycled on checkout. This setting is useful for environments where connections are happening through a proxy like HAProxy which automatically closes connections after a specified interval.\n\n### Proxies\n\n*flask_nameko.**FlaskPooledClusterRpcProxy**(app=None, connect_on_method_call=True)*\n\n This class is used to create a pool of connections to a Nameko cluster. It provides the following options:\n \n * `connect_on_method_call` - if this is true, the connection to a service is created when a method is called on a service rather than when the service is accessed\n\n *init_app(app=None)*\n\n Configure the proxy for a given app.\n\n## Development\n\n $ git clone git@github.com:jessepollak/flask_nameko.git flask_nameko\n $ cd flask_nameko\n $ make develop\n\n\n=======\nHistory\n=======\n\n`1.4.0 `__ (2017-09-10)\n-------------------------------------------------------------------------------------\n\nFeatures\n~~~~~~~~~~~~~\n\n- **Python**: Python 3 support + fix pep8 voilations\n (`69d116 `__)\n\n`1.3.0 `__ (2016-09-20)\n-------------------------------------------------------------------------------------\n\nDocumentation\n~~~~~~~~~~~~~\n\n- **README**: adds docs for NAMEKO\\_POOL\\_RECYCLE\n (`a27a1be `__)\n\nFeatures\n~~~~~~~~\n\n- **ConnectionPool**: add pool recycling to eliminate closed connection\n issue\n (`4d90f1d `__)\n\n`1.2.0 `__ (2016-09-16)\n-------------------------------------------------------------------------------------\n\nFeatures\n~~~~~~~~\n\n- **PooledClusterRpcProxy**: add support for NAMEKO\\_RPC\\_TIMEOUT\n setting\n (`d4d6042 `__)\n\n`1.1.0 `__ (2016-08-09)\n-------------------------------------------------------------------------------------\n\nFeatures\n~~~~~~~~\n\n- **FlaskPooledClusterRpcProxy**: add lazy\\_load\\_services config\n (`26184f6 `__)\n\n`0.1.0 `__ (2016-07-28)\n-----------------------------------------------------------------------------------------------------------------------\n\nFeatures\n~~~~~~~~\n\n- **flask\\_nameko**: adds FlaskPooledClusterRpcProxy\n (`285df05 `__)\n\n0.1.0\n------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/clef/flask_nameko", "keywords": "flask_nameko", "license": "ISCL", "maintainer": "", "maintainer_email": "", "name": "flask_nameko", "package_url": "https://pypi.org/project/flask_nameko/", "platform": "", "project_url": "https://pypi.org/project/flask_nameko/", "project_urls": { "Homepage": "https://github.com/clef/flask_nameko" }, "release_url": "https://pypi.org/project/flask_nameko/1.4.0/", "requires_dist": null, "requires_python": "", "summary": "A wrapper for using nameko services with Flask", "version": "1.4.0" }, "last_serial": 3164102, "releases": { "0.1.0": [], "1.0.0": [ { "comment_text": "", "digests": { "md5": "b8919f96c84dc65ab564ac83dc6d6409", "sha256": "eb2e63eb5b853a284a7d64698f60632a357cf817676be053aea4347419396b50" }, "downloads": -1, "filename": "flask_nameko-1.0.0.tar.gz", "has_sig": false, "md5_digest": "b8919f96c84dc65ab564ac83dc6d6409", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5421, "upload_time": "2016-07-28T22:34:58", "url": "https://files.pythonhosted.org/packages/4f/94/a6e6d47ca841d6aa2a370eaf284afbd8588bee50dcf7508705fdf6c948a5/flask_nameko-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "ed4fdcfb82cdb8c04b22de568ad3176a", "sha256": "a86dc273626d4aef1e147bfde43340f45adb78933b184605d235b532ae91f4bf" }, "downloads": -1, "filename": "flask_nameko-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ed4fdcfb82cdb8c04b22de568ad3176a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5504, "upload_time": "2016-07-29T17:23:34", "url": "https://files.pythonhosted.org/packages/18/5d/95aa6897b6614f2b0f994c00ad1734402ccfac16ff5284293e3d20297637/flask_nameko-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "2568dda5d10ec59fbf7e457acf9702c2", "sha256": "adf45c507d924ecf4bbac8fdb1793eea12ed0beed43160878adb6c1b2a80747e" }, "downloads": -1, "filename": "flask_nameko-1.0.2.tar.gz", "has_sig": false, "md5_digest": "2568dda5d10ec59fbf7e457acf9702c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6001, "upload_time": "2016-08-10T04:05:21", "url": "https://files.pythonhosted.org/packages/97/f2/2006d90d038d353975d0cce88deba34498dffdc672f598c10ab6363e885b/flask_nameko-1.0.2.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "3b150d84b907dffaa325da584b1018d6", "sha256": "ebd7c6997e4839f8ab72e76461d01c6310968ce1ff40f8fd0de77e8c1c68f865" }, "downloads": -1, "filename": "flask_nameko-1.1.1.tar.gz", "has_sig": false, "md5_digest": "3b150d84b907dffaa325da584b1018d6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6001, "upload_time": "2016-08-10T04:06:49", "url": "https://files.pythonhosted.org/packages/9d/61/5d70ad99d1cb949a851abc32ec5041b473d2cbaf72f47dd3071d6043e589/flask_nameko-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "fd6e7656cea3779d28954496bc47f70a", "sha256": "7aaf56e3a56dc02f3ec4a76e788a4b1062aeb92de7ea14a381339ccf17d5f689" }, "downloads": -1, "filename": "flask_nameko-1.2.0.tar.gz", "has_sig": false, "md5_digest": "fd6e7656cea3779d28954496bc47f70a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6338, "upload_time": "2016-09-16T18:32:38", "url": "https://files.pythonhosted.org/packages/ca/b6/489774717a70015f6ca6e87fb7ef32965408bb54698c2c06258d51bec3a2/flask_nameko-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "13c436c93882c59dbd6d0bd7858587c4", "sha256": "53be84fd729d8465b2e35ba7a2130fe598ef312d33fc1a0bd74146f8eab21862" }, "downloads": -1, "filename": "flask_nameko-1.3.0.tar.gz", "has_sig": false, "md5_digest": "13c436c93882c59dbd6d0bd7858587c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7084, "upload_time": "2016-09-20T21:23:54", "url": "https://files.pythonhosted.org/packages/17/fa/e913f9a41b3c9b91d3f8b74905a0351675ebce3e4c9f011a4eca87fe046a/flask_nameko-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "d28dce29e8399d0b9fef116afafc593c", "sha256": "fbf5790cada16e1c9a7861423dd4295ccd4beb08b5c4f4451544a11cf5841880" }, "downloads": -1, "filename": "flask_nameko-1.4.0.tar.gz", "has_sig": false, "md5_digest": "d28dce29e8399d0b9fef116afafc593c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2017-09-11T00:14:02", "url": "https://files.pythonhosted.org/packages/a7/59/77af16c07696036f2ab167013f6275960dad4880dd485220b39d940399c1/flask_nameko-1.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d28dce29e8399d0b9fef116afafc593c", "sha256": "fbf5790cada16e1c9a7861423dd4295ccd4beb08b5c4f4451544a11cf5841880" }, "downloads": -1, "filename": "flask_nameko-1.4.0.tar.gz", "has_sig": false, "md5_digest": "d28dce29e8399d0b9fef116afafc593c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2017-09-11T00:14:02", "url": "https://files.pythonhosted.org/packages/a7/59/77af16c07696036f2ab167013f6275960dad4880dd485220b39d940399c1/flask_nameko-1.4.0.tar.gz" } ] }