{ "info": { "author": "bluele", "author_email": "jksmphone@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============\nRedis-Semaphore\n===============\n\n.. image:: https://travis-ci.org/bluele/redis-semaphore.svg?branch=master\n :target: https://travis-ci.org/bluele/redis-semaphore\n\n\nA distributed semaphore and mutex built on Redis.\n\n\nInstallation\n------------\nTo install redis-semaphore, simply::\n\n pip install redis-semaphore\n\n\nOr alternatively, you can download the repository and install manually by doing::\n\n git clone git@github.com:bluele/redis-semaphore.git\n cd redis-semaphore\n python setup.py install\n\n\nExamples\n--------\n\n::\n\n from redis import Redis\n from redis_semaphore import Semaphore\n from threading import Thread\n import urllib2\n import time\n\n semaphore = Semaphore(Redis(), count=2, namespace='example')\n\n\n def task(i):\n url = 'https://www.google.co.jp/'\n with semaphore:\n print('id: {} => {}'.format(i, urllib2.urlopen(url).code))\n print('sleep...')\n time.sleep(2)\n\n\n def main():\n threads = list()\n for i in range(5):\n threads.append(Thread(target=task, args=(i,)))\n for th in threads:\n th.start()\n for th in threads:\n th.join()\n\n if __name__ == '__main__':\n main()\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bluele/redis-semaphore", "keywords": "redis semaphore", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Redis-Semaphore", "package_url": "https://pypi.org/project/Redis-Semaphore/", "platform": "", "project_url": "https://pypi.org/project/Redis-Semaphore/", "project_urls": { "Homepage": "https://github.com/bluele/redis-semaphore" }, "release_url": "https://pypi.org/project/Redis-Semaphore/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "A distributed semaphore and mutex built on Redis.", "version": "0.2.2" }, "last_serial": 2497471, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f0fb36baa313dbbb9cb77516135ec63d", "sha256": "d93b45de296b4929919b082ce1c8b0a4ae4e11e96eb288c9325be562638b26e3" }, "downloads": -1, "filename": "Redis-Semaphore-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f0fb36baa313dbbb9cb77516135ec63d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3336, "upload_time": "2014-07-23T07:15:45", "url": "https://files.pythonhosted.org/packages/08/24/933da50e0e6a89f7aa2f95a9ea06b95b784d483cc1a712abf71e57991fd9/Redis-Semaphore-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "built for Darwin-15.3.0", "digests": { "md5": "92710c96773bbc6f09dd160b21c991fa", "sha256": "1ea3cc51e79a799655ba2e9869e46a70098a402c21d2d4bf94e4ea8ed76963d2" }, "downloads": -1, "filename": "Redis-Semaphore-0.2.0.macosx-10.11-intel.tar.gz", "has_sig": false, "md5_digest": "92710c96773bbc6f09dd160b21c991fa", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 6577, "upload_time": "2016-02-29T00:28:00", "url": "https://files.pythonhosted.org/packages/58/d6/31628e754f0ab4d680ee5eb49c0b5dfbf9b355665ac780b9dd67138e72ed/Redis-Semaphore-0.2.0.macosx-10.11-intel.tar.gz" }, { "comment_text": "", "digests": { "md5": "9d85bcc31b00168cabf5cc9d7fce21f9", "sha256": "720feaf510d6576acd7d560858ea1d66d8fe93db72d430da97674519f0d2ecf8" }, "downloads": -1, "filename": "Redis_Semaphore-0.2.0-py2.7.egg", "has_sig": false, "md5_digest": "9d85bcc31b00168cabf5cc9d7fce21f9", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 8001, "upload_time": "2016-02-29T00:28:12", "url": "https://files.pythonhosted.org/packages/eb/fa/5b0966f7a985083536ec58e4039ec317cb07a0823c97b92df5ed5fa1d107/Redis_Semaphore-0.2.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "94e484b810158b50e3d5fce6f5e1b0a9", "sha256": "5d21891e3b829294925aefb12c3a2481c50d24a3e8d3e757414ccdba09328cc7" }, "downloads": -1, "filename": "Redis-Semaphore-0.2.0.tar.gz", "has_sig": false, "md5_digest": "94e484b810158b50e3d5fce6f5e1b0a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3813, "upload_time": "2016-02-29T00:27:54", "url": "https://files.pythonhosted.org/packages/14/ef/3e80aa4a0b87044b1cec5ea49e1414a2f0f26484edc23a47cc6563fa3937/Redis-Semaphore-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "16829de3d558ecc74578ab4776448742", "sha256": "ef1dc2e8328c01f215d9d664fc3bbd5ec9055a49f072fd55c7ab0a13bd053d88" }, "downloads": -1, "filename": "Redis-Semaphore-0.2.1.tar.gz", "has_sig": false, "md5_digest": "16829de3d558ecc74578ab4776448742", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3833, "upload_time": "2016-10-31T01:44:18", "url": "https://files.pythonhosted.org/packages/a1/30/47c43a6dca7741e7fa7b69cd5f8df29fefdbbdc06765964f585fe26061ac/Redis-Semaphore-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "c3ac847879525089ae1b7ae526757342", "sha256": "c3ce7113fda317692c27ed704e3da41444f1c004d5bd19a0aaa56adfda5bbaec" }, "downloads": -1, "filename": "Redis-Semaphore-0.2.2.tar.gz", "has_sig": false, "md5_digest": "c3ac847879525089ae1b7ae526757342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3979, "upload_time": "2016-12-03T15:47:34", "url": "https://files.pythonhosted.org/packages/30/de/431fbf151d1f7cf72b14d6f7ddc700310e6692aac116eda3b1e9800c9f55/Redis-Semaphore-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c3ac847879525089ae1b7ae526757342", "sha256": "c3ce7113fda317692c27ed704e3da41444f1c004d5bd19a0aaa56adfda5bbaec" }, "downloads": -1, "filename": "Redis-Semaphore-0.2.2.tar.gz", "has_sig": false, "md5_digest": "c3ac847879525089ae1b7ae526757342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3979, "upload_time": "2016-12-03T15:47:34", "url": "https://files.pythonhosted.org/packages/30/de/431fbf151d1f7cf72b14d6f7ddc700310e6692aac116eda3b1e9800c9f55/Redis-Semaphore-0.2.2.tar.gz" } ] }