{ "info": { "author": "Julio Trigo", "author_email": "julio.trigo@sohonet.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Database", "Topic :: Database :: Front-Ends", "Topic :: Internet", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Nameko Redis Keyspace Notifications\n===================================\n\n.. pull-quote::\n\n Nameko_ `Redis Keyspace Notifications`_ extension.\n\n\n.. image:: https://img.shields.io/pypi/v/nameko-rediskn.svg\n :target: https://pypi.org/project/nameko-rediskn/\n\n.. image:: https://img.shields.io/pypi/pyversions/nameko-rediskn.svg\n :target: https://pypi.org/project/nameko-rediskn/\n\n.. image:: https://img.shields.io/pypi/format/nameko-rediskn.svg\n :target: https://pypi.org/project/nameko-rediskn/\n\n.. image:: https://travis-ci.org/sohonetlabs/nameko-rediskn.svg?branch=master\n :target: https://travis-ci.org/sohonetlabs/nameko-rediskn\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n\n\nUsage\n-----\n\nThis Nameko_ extension adds the ability to subscribe to events, keys and\ndatabases.\n\nSome event examples:\n\n- ``expire`` events fired for ``EXPIRE`` commands\n- ``expired`` events fired when a key gets deleted due to expiration\n\nUsage example:\n\n .. code-block:: python\n\n from nameko_rediskn import rediskn, REDIS_PMESSAGE_TYPE\n\n\n class MyService:\n\n name = 'my-service'\n\n @rediskn.subscribe(uri_config_key='MY_REDIS', keys='foo/bar-*')\n def subscriber(self, message):\n if message['type'] != REDIS_PMESSAGE_TYPE:\n return\n\n event_type = message['data']\n if event_type != 'expired':\n return\n\n key = message['channel'].split(':')[1]\n\n # ...\n\nWhere ``subscribe`` accepts:\n\n- ``MY_REDIS``, which is the attribute name referring to he Redis URI\n (see the Configuration_ section below).\n- ``events``, ``keys`` and ``dbs`` as a single value (string) or a\n list of values to subscribe to. They are all optional but at least one\n of those arguments must be provided.\n\nFor more information, you can check the documentation of the\n``RedisKNEntrypoint`` entrypoint.\n\n**NOTE**: this dependency is not \"cluster-aware\" and fires on all service\ninstances. There are different ways to solve that: using ddebounce_ is\none of them.\n\n\nConfiguration\n-------------\n\nNameko_ configuration file:\n\n .. code-block:: yaml\n\n # config.yaml\n\n REDIS:\n notification_events: \"KEA\"\n pubsub_backoff_factor: 3\n\n REDIS_URIS:\n MY_REDIS: \"redis://localhost:6380/0\"\n\n``REDIS[notification_events]`` is optional and can be omited or just\ncontain ``None``. Otherwise, it must have a valid value for the\n``'notify-keyspace-events'`` Redis client configuration attribute. This\nshould be ideally set on the server side, as setting it in one of the\nRedis clients will affect the rest of them.\n\n``REDIS[pubsub_backoff_factor]`` sets the exponential backoff factor for\nreconnecting to Redis on errors. If an error occurs while listening for Redis\nevents, we sleep for ``backoff_factor * 2 ** (n - 1)`` where ``n`` is the\nnumber of consecutive errors that have occurred. If omitted, this defaults\nto ``2``.\n\n``REDIS_URIS`` follows the config format used by the `Nameko Redis`_\ndependency provider, where ``MY_REDIS`` is just the attribute name\nrefering to the Redis URI of the instance being used.\n\n\nTests\n-----\n\n**RabbitMQ** should be up and running on the default URI\n``guest:guest@localhost`` and using the default ports.\n\n**Redis** should be also running on the default port.\n\nThere are Makefile targets to run both RabbitMQ and Redis docker\ncontainers locally using the default ports and configuration:\n\n .. code-block:: shell\n\n $ make rabbitmq-container\n $ make redis-container\n\nA virtual environment should be set up and up to date:\n\n.. code-block:: shell\n\n $ # Create/activate a virtual environment\n $ pip install -U pip setuptools wheel\n\n``tox`` can be used to run the tests. It is recomented that all its\ndependencies, specially ``virtualenv``, are up to date, so that it uses\nthe correct version of libraries like ``pip``, ``setuptools`` and\n``wheel``:\n\n.. code-block:: shell\n\n $ pip install -U --upgrade-strategy=eager tox\n $ tox\n $ tox -e \"py37-namekolatest-redislatest-test\"\n\nThere are other Makefile targets that can be used to run the tests, but\nextra dependencies will have to be installed, including this package in\ndevelop mode:\n\n.. code-block:: shell\n\n $ pip install -U --editable \".[dev]\"\n $ make test\n $ make coverage\n\nA different RabbitMQ URI can be provided overriding the following\nenvironment variables: ``RABBIT_CTL_URI`` and ``AMQP_URI``.\n\nAdditional ``pytest`` parameters can be also provided using the ``ARGS``\nvariable:\n\n.. code-block:: shell\n\n $ make test RABBIT_CTL_URI=http://guest:guest@localhost:15673 AMQP_URI=amqp://guest:guest@localhost:5673 ARGS='-x -vv --disable-warnings'\n $ make coverage RABBIT_CTL_URI=http://guest:guest@localhost:15673 AMQP_URI=amqp://guest:guest@localhost:5673 ARGS='-x -vv --disable-warnings'\n\n\nLinting\n~~~~~~~\n\nTo run linting checks using ``tox``:\n\n.. code-block:: shell\n\n $ for env in $(tox -l - | grep linting); do tox -e $env; done\n\n\nNameko support\n--------------\n\nThe following Nameko_ versions are actively supported: ``2.11``,\n``2.12``.\n\nHowever, this extension should work from, at least, Nameko_ ``2.6``\nonwards.\n\n\nRedis support\n-------------\n\nThe following `Redis Python`_ versions are actively supported: ``2.10``,\n``3.0``, ``3.1``, ``3.2``.\n\nRedis_ ``4.0`` is actively supported.\n\n\nChangelog\n---------\n\nConsult the CHANGELOG_ document for fixes and enhancements of each\nversion.\n\n\nLicense\n-------\n\nThe MIT License. See LICENSE_ for details.\n\n\n.. _Nameko: http://nameko.readthedocs.org\n.. _Redis Python: https://github.com/andymccurdy/redis-py\n.. _Redis: https://redis.io\n.. _Redis Keyspace Notifications: https://redis.io/topics/notifications\n.. _Nameko Redis: https://github.com/etataurov/nameko-redis\n.. _CHANGELOG: https://github.com/sohonetlabs/nameko-rediskn/blob/master/CHANGELOG.rst\n.. _LICENSE: https://github.com/sohonetlabs/nameko-rediskn/blob/master/LICENSE\n.. _ddebounce: https://github.com/iky/ddebounce\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sohonetlabs/nameko-rediskn", "keywords": "nameko redis keyspace notifications extension", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "nameko-rediskn", "package_url": "https://pypi.org/project/nameko-rediskn/", "platform": "", "project_url": "https://pypi.org/project/nameko-rediskn/", "project_urls": { "Homepage": "https://github.com/sohonetlabs/nameko-rediskn" }, "release_url": "https://pypi.org/project/nameko-rediskn/0.1.1/", "requires_dist": [ "nameko (>=2.6)", "redis (>=2.10.5)", "pytest (<5.0.0) ; extra == 'dev'", "coverage (~=4.5.3) ; extra == 'dev'", "flake8 ; extra == 'dev'", "flake8-bugbear ; extra == 'dev'", "isort ; extra == 'dev'", "check-manifest ; extra == 'dev'", "restructuredtext-lint ; extra == 'dev'", "Pygments ; extra == 'dev'", "black ; (python_version > \"3.5\") and extra == 'dev'" ], "requires_python": "", "summary": "Nameko Redis Keyspace Notifications extension.", "version": "0.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 6043543, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3e82d23e2ccdd139d65f304d278dee26", "sha256": "0890dc2ed6a09398b226427a19ce450da5c6d766e2152c5294056baa2c9c17bd" }, "downloads": -1, "filename": "nameko_rediskn-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "3e82d23e2ccdd139d65f304d278dee26", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2425, "upload_time": "2019-03-17T17:20:01", "upload_time_iso_8601": "2019-03-17T17:20:01.853939Z", "url": "https://files.pythonhosted.org/packages/1e/e8/b4cd8621ed543a9e8f0b391b4147cfc0121a863c1a87f57ff8416f8a18f3/nameko_rediskn-0.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "e569d19798224b85c909642f53efaa7b", "sha256": "7219af5cc0ae32a6a90acac532afc9e5ee718020440f3b8cba48648379b0311c" }, "downloads": -1, "filename": "nameko-rediskn-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e569d19798224b85c909642f53efaa7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4402, "upload_time": "2019-03-17T17:20:03", "upload_time_iso_8601": "2019-03-17T17:20:03.814302Z", "url": "https://files.pythonhosted.org/packages/bf/1e/c57bb0435f1c7be0e1e43c8329f15e4b00a15f1f4fc4fb2613b360c6892d/nameko-rediskn-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0882323608da6de3ebeddda31eda6122", "sha256": "933933cccdefcae53c71abd7a046376ad5ed0fa231a74f8ff2e249d0b1e73ff1" }, "downloads": -1, "filename": "nameko_rediskn-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0882323608da6de3ebeddda31eda6122", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7386, "upload_time": "2019-08-09T14:57:06", "upload_time_iso_8601": "2019-08-09T14:57:06.033752Z", "url": "https://files.pythonhosted.org/packages/bf/80/855c329666d115363dc1b645148e621cbfe59e2ed2544864f8de862791c8/nameko_rediskn-0.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "6c51a20aa4d92447c54115d6b3cab19e", "sha256": "a1c366e24cd9f0fd3e12bf4d2a895283f48a149d48a984500ce0e42365f7c123" }, "downloads": -1, "filename": "nameko-rediskn-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6c51a20aa4d92447c54115d6b3cab19e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7664, "upload_time": "2019-08-09T14:57:07", "upload_time_iso_8601": "2019-08-09T14:57:07.959378Z", "url": "https://files.pythonhosted.org/packages/78/56/ac39ed90a752ea9ece8f71c20445687ffbc2bd6f4fcbf845946dedd70541/nameko-rediskn-0.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "29625b01efb0ad609070620851983839", "sha256": "2ac1a473470ee86dca3d4c3617cc888c3fcb24d013e0f0eb7868b730b21bbae4" }, "downloads": -1, "filename": "nameko_rediskn-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "29625b01efb0ad609070620851983839", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7895, "upload_time": "2019-10-28T19:43:04", "upload_time_iso_8601": "2019-10-28T19:43:04.738153Z", "url": "https://files.pythonhosted.org/packages/bd/f3/45494ed5ff30cbcc6c2b3b40aed43228573fa26682d5bf13d0d5f36b8b24/nameko_rediskn-0.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9405546a43b7b24a2b3da20358cca26c", "sha256": "7503369f7d48d61fef3e41dce355d429a61b2411a56c6fa0534767047b44048e" }, "downloads": -1, "filename": "nameko-rediskn-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9405546a43b7b24a2b3da20358cca26c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8183, "upload_time": "2019-10-28T19:43:06", "upload_time_iso_8601": "2019-10-28T19:43:06.860799Z", "url": "https://files.pythonhosted.org/packages/8d/e7/99218e19a6a93cfb8d0d7420f41ba809c692f649e938ea0ea67ad2807f2f/nameko-rediskn-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "29625b01efb0ad609070620851983839", "sha256": "2ac1a473470ee86dca3d4c3617cc888c3fcb24d013e0f0eb7868b730b21bbae4" }, "downloads": -1, "filename": "nameko_rediskn-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "29625b01efb0ad609070620851983839", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7895, "upload_time": "2019-10-28T19:43:04", "upload_time_iso_8601": "2019-10-28T19:43:04.738153Z", "url": "https://files.pythonhosted.org/packages/bd/f3/45494ed5ff30cbcc6c2b3b40aed43228573fa26682d5bf13d0d5f36b8b24/nameko_rediskn-0.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "9405546a43b7b24a2b3da20358cca26c", "sha256": "7503369f7d48d61fef3e41dce355d429a61b2411a56c6fa0534767047b44048e" }, "downloads": -1, "filename": "nameko-rediskn-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9405546a43b7b24a2b3da20358cca26c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8183, "upload_time": "2019-10-28T19:43:06", "upload_time_iso_8601": "2019-10-28T19:43:06.860799Z", "url": "https://files.pythonhosted.org/packages/8d/e7/99218e19a6a93cfb8d0d7420f41ba809c692f649e938ea0ea67ad2807f2f/nameko-rediskn-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }