{ "info": { "author": "Mardigon Toler", "author_email": "", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "# loto : Lockout-Tagout\n\nLoto provides a simple decorator for functions\nthat need to access critical sections with mutex locks.\n\nWhen you decorate a function with `@LockoutTagout(tag)`,\nthe function call will block until it can acquire a mutex lock\nshared between all functions with the same tag.\n\n\n## Example\n\n```python\nfrom loto import LockoutTagout\n\nfrom threading import Thread\nfrom random import random\nfrom time import sleep\n\ndata = [1, 2, 3]\n\n@LockoutTagout('data1')\ndef readData1(sharedData):\n for val in sharedData:\n print(val)\n sleep(random())\n\n@LockoutTagout('data1')\ndef writeData1(sharedData):\n for i in range(0, 3):\n sharedData[i] += 1\n sleep(random())\n\nfor i in range(0, 5):\n Thread(target=readData1, args=(data,)).start()\n Thread(target=writeData1, args=(data,)).start()\n```\n\nThese two functions will lockout-tagout with the same tag,\nso they will acquire a lock managed by this decorator class before\nthey're executed. This means that no two functions with the same\ntag can be executing concurrently.\n\n\nOne mutex lock is managed per unique tag.\n\n\n## Installation\nYou can install this module from PyPI with\n```\npip install loto\n```\n\n\n", "description_content_type": "text/markdown; charset=UTF-8; variant=GFM", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mardigontoler/loto", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "loto", "package_url": "https://pypi.org/project/loto/", "platform": "", "project_url": "https://pypi.org/project/loto/", "project_urls": { "Homepage": "https://github.com/mardigontoler/loto" }, "release_url": "https://pypi.org/project/loto/0.1.5/", "requires_dist": [ "pytest" ], "requires_python": ">=3", "summary": "Decorator for tagging critical sections locking them out", "version": "0.1.5" }, "last_serial": 5590399, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "0085f2aa81aeadfb441b88b23d22b259", "sha256": "fd20786075032be38bad8e5a6c31365096d23486f5d5cdc8fdcb4fb83493a0e1" }, "downloads": -1, "filename": "loto-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "0085f2aa81aeadfb441b88b23d22b259", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 4217, "upload_time": "2019-07-26T18:19:11", "url": "https://files.pythonhosted.org/packages/6b/f8/54947d01e73d8dd0d821495b6397b1d45e01c7bdb8cc7b711d4cd165b050/loto-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f1b20205dc8e9315a44b121943a9ea09", "sha256": "e37c8cb20ada6ee47610022fab64bc1157cd18916f5a7ae5e193db0042ce5327" }, "downloads": -1, "filename": "loto-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f1b20205dc8e9315a44b121943a9ea09", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 2894, "upload_time": "2019-07-26T18:19:14", "url": "https://files.pythonhosted.org/packages/0b/59/db495b39e2a435b199c97a3bd2aacd6d6dc1020463683332d11998022c7c/loto-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "80966a15bef8b8fc0d18966a501409fb", "sha256": "8cc11527ab765864c8203f3f9aa57b3ee3e6fe0bd7e35b4d833b96a0aa7cf028" }, "downloads": -1, "filename": "loto-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "80966a15bef8b8fc0d18966a501409fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 4295, "upload_time": "2019-07-26T19:06:33", "url": "https://files.pythonhosted.org/packages/0b/e6/5ae9d6988d627dcf4c87c8d5b649426f2722c71a22a8292041ac9c89659b/loto-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a1c2c4f3e3dd7f2d0ff236e4b510e84", "sha256": "605ceb33136ed002179362ea7653ffeee422208a8da399546be165abb8c51470" }, "downloads": -1, "filename": "loto-0.1.5.tar.gz", "has_sig": false, "md5_digest": "9a1c2c4f3e3dd7f2d0ff236e4b510e84", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 2928, "upload_time": "2019-07-26T19:06:35", "url": "https://files.pythonhosted.org/packages/31/ed/f4ef2968888f1ffa41eed7bee8e090d2122f9f3c622342b2e1ebfbf9ab4c/loto-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "80966a15bef8b8fc0d18966a501409fb", "sha256": "8cc11527ab765864c8203f3f9aa57b3ee3e6fe0bd7e35b4d833b96a0aa7cf028" }, "downloads": -1, "filename": "loto-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "80966a15bef8b8fc0d18966a501409fb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 4295, "upload_time": "2019-07-26T19:06:33", "url": "https://files.pythonhosted.org/packages/0b/e6/5ae9d6988d627dcf4c87c8d5b649426f2722c71a22a8292041ac9c89659b/loto-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a1c2c4f3e3dd7f2d0ff236e4b510e84", "sha256": "605ceb33136ed002179362ea7653ffeee422208a8da399546be165abb8c51470" }, "downloads": -1, "filename": "loto-0.1.5.tar.gz", "has_sig": false, "md5_digest": "9a1c2c4f3e3dd7f2d0ff236e4b510e84", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 2928, "upload_time": "2019-07-26T19:06:35", "url": "https://files.pythonhosted.org/packages/31/ed/f4ef2968888f1ffa41eed7bee8e090d2122f9f3c622342b2e1ebfbf9ab4c/loto-0.1.5.tar.gz" } ] }