{
"info": {
"author": "Leonardo Zhou",
"author_email": "glasslion@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4"
],
"description": "|RedLock logo|\n\nRedLock - Distributed locks with Redis and Python\n-------------------------------------------------\n\n|Build Status|\n\nThis library implements the RedLock algorithm introduced by\n`@antirez `__\n\nYet another ...\n~~~~~~~~~~~~~~~\n\nThere are already a few redis based lock implementations in the Python\nworld, e.g. `retools `__,\n`redis-lock `__.\n\nHowever, these libraries can only work with *single-master* redis\nserver. When the Redis master goes down, your application has to face a\nsingle point of failure . We can't rely on the master-slave replication,\nbecause Redis replication is asynchronous.\n\n This is an obvious race condition with the master-slave replication\n model :\n\n #. Client A acquires the lock into the master.\n #. The master crashes before the write to the key is transmitted to\n the slave.\n #. The slave gets promoted to master.\n #. Client B acquires the lock to the same resource A already holds a\n lock for. SAFETY VIOLATION!\n\nA quick introduction to the RedLock algorithm\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo resolve this problem, the Redlock algorithm assume we have ``N``\nRedis masters. These nodes are totally independent (no replications). In\norder to acquire the lock, the client will try to acquire the lock in\nall the N instances sequentially. If and only if the client was able to\nacquire the lock in the majority (``(N+1)/2``)of the instances, the lock\nis considered to be acquired.\n\nThe detailed description of the RedLock algorithm can be found in the\nRedis documentation: `Distributed locks with\nRedis `__.\n\nAPIs\n~~~~\n\nThe ``redlock.RedLock`` class shares a similar API with the\n``threading.Lock`` class in the Python Standard Library.\n\nBasic Usage\n^^^^^^^^^^^\n\n.. code:: python\n\n from redlock import RedLock\n # By default, if no redis connection details are \n # provided, RedLock uses redis://127.0.0.1:6379/0\n lock = RedLock(\"distributed_lock\")\n lock.acquire()\n do_something()\n lock.release()\n\nWith Statement / Context Manager\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAs with ``threading.Lock``, ``redlock.RedLock`` objects are context\nmanagers thus support the `With\nStatement `__.\nThis way is more pythonic and recommended.\n\n.. code:: python\n\n from redlock import RedLock\n with RedLock(\"distributed_lock\"):\n do_something()\n\nSpecify multiple Redis nodes\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n from redlock import RedLock\n with RedLock(\"distributed_lock\", \n connection_details=[\n {'host': 'xxx.xxx.xxx.xxx', 'port': 6379, 'db': 0},\n {'host': 'xxx.xxx.xxx.xxx', 'port': 6379, 'db': 0},\n {'host': 'xxx.xxx.xxx.xxx', 'port': 6379, 'db': 0},\n {'host': 'xxx.xxx.xxx.xxx', 'port': 6379, 'db': 0},\n ]\n ):\n do_something()\n\n| The ``connection_details`` parameter expects a list of keyword\narguments for initializing Redis clients.\n| Other acceptable Redis client arguments can be found on the `redis-py\ndoc `__.\n\nReuse Redis clients with the RedLockFactory\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nUsually the connection details of the Redis nodes are fixed.\n``RedLockFactory`` can help reuse them, create multiple RedLocks but\nonly initialize the clients once.\n\n.. code:: python\n\n from redlock import RedLockFactory\n factory = RedLockFactory(\n connection_details=[\n {'host': 'xxx.xxx.xxx.xxx'},\n {'host': 'xxx.xxx.xxx.xxx'},\n {'host': 'xxx.xxx.xxx.xxx'},\n {'host': 'xxx.xxx.xxx.xxx'},\n ])\n\n with factory.create_lock(\"distributed_lock\"):\n do_something()\n\n with factory.create_lock(\"another_lock\"):\n do_something()\n\n.. |RedLock logo| image:: https://github.com/glasslion/redlock/raw/master/docs/assets/redlock-small.png\n.. |Build Status| image:: https://travis-ci.org/glasslion/redlock.svg?branch=master\n :target: https://travis-ci.org/glasslion/redlock",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/glasslion/redlock",
"keywords": "redis lock distributed",
"license": "MIT",
"maintainer": null,
"maintainer_email": null,
"name": "redlock",
"package_url": "https://pypi.org/project/redlock/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/redlock/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/glasslion/redlock"
},
"release_url": "https://pypi.org/project/redlock/1.2.0/",
"requires_dist": null,
"requires_python": null,
"summary": "Distributed locks with Redis",
"version": "1.2.0"
},
"last_serial": 1872024,
"releases": {
"0.0.1": [],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "8d3cacea2f35defc9e8e06749396f9b7",
"sha256": "da3c7f16c5309cfbcdae0924f596cc326bad05f9ebcdd90fa7adb714f33e3df2"
},
"downloads": -1,
"filename": "redlock-0.1.2-py2-none-any.whl",
"has_sig": false,
"md5_digest": "8d3cacea2f35defc9e8e06749396f9b7",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 3592,
"upload_time": "2014-11-10T03:40:47",
"url": "https://files.pythonhosted.org/packages/b6/37/26ec57611ca5f502166a6f9ce049daa09c92a9597f8f3666adb1fcd40642/redlock-0.1.2-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "3dd2ed3f9770484b684b1d3e6e572352",
"sha256": "b5dc592c563d31257600a711c67dbc8a234958f16afc446b9f0c52b6ee3eaf31"
},
"downloads": -1,
"filename": "redlock-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "3dd2ed3f9770484b684b1d3e6e572352",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2964,
"upload_time": "2014-11-10T03:29:06",
"url": "https://files.pythonhosted.org/packages/05/8c/2feaaf64650356e1b1f5b25c9eb877b797306c38295d4b59de54a30be8e0/redlock-0.1.2.tar.gz"
}
],
"0.1.3": [
{
"comment_text": "",
"digests": {
"md5": "1112b385e9c75a30d6f8ae80bb8477f6",
"sha256": "86cbe3fdb4bfc71de9db2f7bfff5cf9df9a3cba5c5481afc3c6bd44dd7113863"
},
"downloads": -1,
"filename": "redlock-0.1.3-py2-none-any.whl",
"has_sig": false,
"md5_digest": "1112b385e9c75a30d6f8ae80bb8477f6",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 4708,
"upload_time": "2014-11-10T03:45:00",
"url": "https://files.pythonhosted.org/packages/e1/67/2d550ac31a3dc311056361615b964328bb1f8fcccacbc175bfcd3de57b76/redlock-0.1.3-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "ee4f438b30f43d8df1428f6e644e9e5d",
"sha256": "718c2142f636fbc0ee2cf1a02e5e10d2e73b30b05ef90f274f8bac51ae9c30eb"
},
"downloads": -1,
"filename": "redlock-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "ee4f438b30f43d8df1428f6e644e9e5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3637,
"upload_time": "2014-11-10T03:44:56",
"url": "https://files.pythonhosted.org/packages/48/06/e266dde6f7c9250b709ddaa110e651ddc32cee9f0fe2fbc2e08a9f0f6bda/redlock-0.1.3.tar.gz"
}
],
"0.1.4": [
{
"comment_text": "",
"digests": {
"md5": "ef7ae4f82e3a6d5642f69b0d30898299",
"sha256": "74cabfe49c2da006c8f47d986cf169767c26b956616d93585c39c7e47aebd742"
},
"downloads": -1,
"filename": "redlock-0.1.4-py2-none-any.whl",
"has_sig": false,
"md5_digest": "ef7ae4f82e3a6d5642f69b0d30898299",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 4680,
"upload_time": "2014-11-10T04:50:20",
"url": "https://files.pythonhosted.org/packages/88/9b/a3e74b6562f62b85884322907a5ce13cff1f47c935831d30689a7529d42d/redlock-0.1.4-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "ead761231ed6694a0054f07c7712dfbb",
"sha256": "06a3a2a6a015e4a47ae0417fafa3312e0923d60b04d19dc9471ed510559fcb13"
},
"downloads": -1,
"filename": "redlock-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "ead761231ed6694a0054f07c7712dfbb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3630,
"upload_time": "2014-11-10T04:50:16",
"url": "https://files.pythonhosted.org/packages/60/cf/90de8e781fd6422a8539e6329d34c163f4c624cca33b2a667cc28aa8c377/redlock-0.1.4.tar.gz"
}
],
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "82c20dfd09e0e95bd47101f86d1d0483",
"sha256": "4c95a4f22a93066e979196a80e571b06ffd19e674f76efe6d52658a1c16960a7"
},
"downloads": -1,
"filename": "redlock-1.0.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "82c20dfd09e0e95bd47101f86d1d0483",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 6971,
"upload_time": "2014-11-10T10:09:34",
"url": "https://files.pythonhosted.org/packages/bb/47/db0c85d09bfb6d0195714ce59e2c53f2838902c12cdad6ae1a3cd1db4928/redlock-1.0.0-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "79eb054ce3b2d64a6b7c80557ec339da",
"sha256": "29b5b853c9aa4e08a5e729f9fa39a84281449b05d6aa4028a710d61e51d1ff98"
},
"downloads": -1,
"filename": "redlock-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "79eb054ce3b2d64a6b7c80557ec339da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6429,
"upload_time": "2014-11-10T10:09:29",
"url": "https://files.pythonhosted.org/packages/ea/41/592665c423fb0595a7f70c4fc0f9ee4582fc2d5a7bb8264d527fd2add29b/redlock-1.0.0.tar.gz"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "3645d59595d0b783b1b5da27f6bf100d",
"sha256": "b377bffed72d0e052cb2d3cc60303da15586d4292cde0e5e3bf7b95c2cc40a99"
},
"downloads": -1,
"filename": "redlock-1.1.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "3645d59595d0b783b1b5da27f6bf100d",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": null,
"size": 4108,
"upload_time": "2015-07-15T09:00:25",
"url": "https://files.pythonhosted.org/packages/8c/81/ca11ba1b7eb147b6f938bddbddecc0f49288debee3f507073f75e61c1a6f/redlock-1.1.0-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "933f839d0cb85539e7f59e8f8110f5ec",
"sha256": "96bac7fd2c6c5c9db534d13c3598bb683e6f26bc9f54b4cfdc7e1a6a8f764800"
},
"downloads": -1,
"filename": "redlock-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "933f839d0cb85539e7f59e8f8110f5ec",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5058,
"upload_time": "2015-07-15T09:00:29",
"url": "https://files.pythonhosted.org/packages/bc/49/8149ab450b019e7b428390bf0957997f646bd0761c68deb76e31c0b304b7/redlock-1.1.0.tar.gz"
}
],
"1.2.0": [
{
"comment_text": "",
"digests": {
"md5": "9a3a2c7368bb27c27668f50aa973230e",
"sha256": "ce7e6ab404882b64a9c5017c7a78b1a3714f2c712635bcb22cbb74d20719bbd1"
},
"downloads": -1,
"filename": "redlock-1.2.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "9a3a2c7368bb27c27668f50aa973230e",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 7302,
"upload_time": "2015-12-21T12:01:48",
"url": "https://files.pythonhosted.org/packages/89/ff/1e35ad7f0d1a4c367e27d905b468a49096d58d86c4f022a4a27e1e79814d/redlock-1.2.0-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8be649953c447c8b456f8c10191733d3",
"sha256": "b718646239d300745475a76e81d350ec523e7146cf84d696b3c4a7dfdd5dd4d4"
},
"downloads": -1,
"filename": "redlock-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "8be649953c447c8b456f8c10191733d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7163,
"upload_time": "2015-12-21T12:01:05",
"url": "https://files.pythonhosted.org/packages/e1/e1/18cccf47bfeefa66dd7cd90b106c5e72922cd9577b0aa8518847836d0391/redlock-1.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "9a3a2c7368bb27c27668f50aa973230e",
"sha256": "ce7e6ab404882b64a9c5017c7a78b1a3714f2c712635bcb22cbb74d20719bbd1"
},
"downloads": -1,
"filename": "redlock-1.2.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "9a3a2c7368bb27c27668f50aa973230e",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 7302,
"upload_time": "2015-12-21T12:01:48",
"url": "https://files.pythonhosted.org/packages/89/ff/1e35ad7f0d1a4c367e27d905b468a49096d58d86c4f022a4a27e1e79814d/redlock-1.2.0-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8be649953c447c8b456f8c10191733d3",
"sha256": "b718646239d300745475a76e81d350ec523e7146cf84d696b3c4a7dfdd5dd4d4"
},
"downloads": -1,
"filename": "redlock-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "8be649953c447c8b456f8c10191733d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7163,
"upload_time": "2015-12-21T12:01:05",
"url": "https://files.pythonhosted.org/packages/e1/e1/18cccf47bfeefa66dd7cd90b106c5e72922cd9577b0aa8518847836d0391/redlock-1.2.0.tar.gz"
}
]
}