{ "info": { "author": "Roman Evstifeev", "author_email": "someuniquename@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Android", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Utilities" ], "description": "This package provides decorators that will try to acquire lock before\ncalling decorated function.\n\nInstallation\n------------\n\n.. code:: bash\n\n pip install lockorator\n\nUsage\n-----\n\nThis package provides two flavours of lock decorators: redis and\nasyncio. Both flavours have the same api.\n\nPackage ``lockorator.asyncio`` provides asyncio lock decorators, also\ncompatible with ``trio``.\n\nPackage ``lockorator.redis`` provides redis lock decorators.\n\nTo use redis locks, set ``LOCKORATOR_REDIS_URL`` in your environment:\n\n::\n\n export LOCKORATOR_REDIS_URL=\"redis://localhost:6379\"\n\nAPI\n~~~\n\nlock_or_exit\n^^^^^^^^^^^^\n\nDecorator. Before decorated function starts, try to acquire lock with\nspecified identifier. If lock is acquired successfully, proceed\nexecuting the function. Otherwise, return immediately. The ``id``\nargument can contain templated string, wich will be rendered with args\nand kwargs, passed to the function.\n\nExample:\n\n.. code:: python\n\n from lockorator.asyncio import lock_or_exit\n\n @lock_or_exit('lock_work_{}')\n def workwork(x):\n pass\n\n workwork(3) # Will try to acquire lock 'lock_work_3'\n\nlock_wait\n^^^^^^^^^\n\nDecorator. Before decorated function starts, try to acquire lock with\nspecified identifier, waiting for ``waittime`` seconds if needed. If\nlock is acquired successfully, proceed executing the function.\nOtherwise, raise ``lockorator.TimeoutError``. The ``id`` argument can\ncontain templated string, wich will be rendered with args and kwargs,\npassed to the function.\n\nExample:\n\n.. code:: python\n\n from lockorator.redis import lock_wait\n\n @lock_wait('lock_work_{}', waittime=4)\n def workwork(x):\n pass\n\n workwork(3) # Will try to acquire lock 'lock_work_3' for 4 seconds\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Fak3/lockorator", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "lockorator", "package_url": "https://pypi.org/project/lockorator/", "platform": "", "project_url": "https://pypi.org/project/lockorator/", "project_urls": { "Homepage": "https://github.com/Fak3/lockorator" }, "release_url": "https://pypi.org/project/lockorator/0.1/", "requires_dist": null, "requires_python": "", "summary": "lock decorators", "version": "0.1" }, "last_serial": 4979491, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "73557ebd373801f6381d09ba2cded386", "sha256": "6a6c29f15957e3d6225d732fda807f2818476e99f7821e2776128e0d15a8c235" }, "downloads": -1, "filename": "lockorator-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "73557ebd373801f6381d09ba2cded386", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4880, "upload_time": "2019-03-24T18:35:08", "url": "https://files.pythonhosted.org/packages/16/f4/e00961a2ffc6a9c9f663b5a6b29f51caeb91477ab5bdc4a8adcbb8a644e4/lockorator-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "929b1e62066758af8bc912d3cfef21bd", "sha256": "c5beda474335f8f892ca1b775cc9e421668e2e9eb512ab65d25c8f586a35b9c2" }, "downloads": -1, "filename": "lockorator-0.1.tar.gz", "has_sig": false, "md5_digest": "929b1e62066758af8bc912d3cfef21bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3013, "upload_time": "2019-03-24T18:35:10", "url": "https://files.pythonhosted.org/packages/2e/82/f75e59aa950b5344e9d7710e90287755862700d94180ab6faea6d05db5b1/lockorator-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73557ebd373801f6381d09ba2cded386", "sha256": "6a6c29f15957e3d6225d732fda807f2818476e99f7821e2776128e0d15a8c235" }, "downloads": -1, "filename": "lockorator-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "73557ebd373801f6381d09ba2cded386", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4880, "upload_time": "2019-03-24T18:35:08", "url": "https://files.pythonhosted.org/packages/16/f4/e00961a2ffc6a9c9f663b5a6b29f51caeb91477ab5bdc4a8adcbb8a644e4/lockorator-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "929b1e62066758af8bc912d3cfef21bd", "sha256": "c5beda474335f8f892ca1b775cc9e421668e2e9eb512ab65d25c8f586a35b9c2" }, "downloads": -1, "filename": "lockorator-0.1.tar.gz", "has_sig": false, "md5_digest": "929b1e62066758af8bc912d3cfef21bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3013, "upload_time": "2019-03-24T18:35:10", "url": "https://files.pythonhosted.org/packages/2e/82/f75e59aa950b5344e9d7710e90287755862700d94180ab6faea6d05db5b1/lockorator-0.1.tar.gz" } ] }