{ "info": { "author": "Nathan Duthoit", "author_email": "nathan@waveapps.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5" ], "description": "Usage\n-----\n\n::\n\n from pylock import Lock\n\n with Lock('a_key', expires=60, timeout=10):\n # do something that should only be done one at a time\n\nConfiguration\n-------------\n\nBackends\n~~~~~~~~\n\nThere are three available backends:\n\nOpen (non-locking) backend\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n DEFAULT_BACKEND = {\n 'class': 'pylock.backends.open_lock.OpenLock',\n 'connection': 'open://'\n }\n\n**Warning** This backend is not a real lock since it can always be\nacquired even if another instance has acquired it already. It is meant\nto be used for testing when you don't want to depend on a running redis\nor memcache instance and don't care about the lock working.\n\nRedis backend\n^^^^^^^^^^^^^\n\n::\n\n DEFAULT_BACKEND = {\n 'class': 'pylock.backends.redis_lock.RedisLock',\n 'connection': 'redis://'\n }\n\nNote: all fields after the scheme are optional, and will default to\nlocalhost on port 6379, using database 0.\n\nMemcache backend (coming soon)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n``DEFAULT_TIMEOUT`` (default: 60)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf another client has already obtained the lock, sleep for a maximum of\nthis many seconds before giving up. A value of 0 means no wait (give up\nright away).\n\nThe default timeout can be overridden when instantiating the lock.\n\n``DEFAULT_EXPIRES`` (default: 10)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nWe consider any existing lock older than this many seconds to be invalid\nin order to detect crashed clients. This value must be higher than it\ntakes the critical section to execute.\n\nThe default expires can be overridden when instantiating the lock.\n\n``KEY_PREFIX`` (default ``'pylock:'``)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is used to prefix the key for the generated lock.\n\nFor ``Lock('somekey')``, the generated key will be ``'pylock:somekey'``\n\nInspired by\n-----------\n\nRedis backend\n~~~~~~~~~~~~~\n\nThe redis backend is almost an exact copy of Ben Bangert's\n```retools.lock`` `_\nwhich is based on `Chris Lamb's\nexample `_\n\nMemcache backend (coming soon)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe memcache backend is inspired by the following: -\nhttps://github.com/snbuback/DistributedLock -\nhttp://jbq.caraldi.com/2010/08/simple-distributed-lock-with-memcached.html\n-\nhttp://www.regexprn.com/2010/05/using-memcached-as-distributed-locking.html\n\nTODO: - better handle redis/memcache connection issues", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/waveaccounting/pylock", "keywords": "lock redis", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pylock", "package_url": "https://pypi.org/project/pylock/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pylock/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/waveaccounting/pylock" }, "release_url": "https://pypi.org/project/pylock/0.3/", "requires_dist": null, "requires_python": null, "summary": "Python Distributed Lock", "version": "0.3" }, "last_serial": 2133101, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "db3d4247717fd98c94642d500f5552b0", "sha256": "e981ba67a75e0672e7ee9bca00206b5f56925d520d8a3fd89148436ec038dafb" }, "downloads": -1, "filename": "pylock-0.2.tar.gz", "has_sig": false, "md5_digest": "db3d4247717fd98c94642d500f5552b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6712, "upload_time": "2013-09-05T16:38:05", "url": "https://files.pythonhosted.org/packages/2f/d9/949209ac0c8a20e2905bc85a233c3cc6c67c95d15a79a10c59bd47ee14e5/pylock-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "36d3775520e3adcc3babb9bd15f78821", "sha256": "1b88e858357c1bad33faa458f65610b8d6c36c1c79a326f73b9912d2c5175779" }, "downloads": -1, "filename": "pylock-0.3.tar.gz", "has_sig": false, "md5_digest": "36d3775520e3adcc3babb9bd15f78821", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6750, "upload_time": "2016-05-25T14:40:12", "url": "https://files.pythonhosted.org/packages/63/3a/87e46fedb813d5b9bf3c685adb8646996ef85e1a18e54888b34fbcc447c0/pylock-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "36d3775520e3adcc3babb9bd15f78821", "sha256": "1b88e858357c1bad33faa458f65610b8d6c36c1c79a326f73b9912d2c5175779" }, "downloads": -1, "filename": "pylock-0.3.tar.gz", "has_sig": false, "md5_digest": "36d3775520e3adcc3babb9bd15f78821", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6750, "upload_time": "2016-05-25T14:40:12", "url": "https://files.pythonhosted.org/packages/63/3a/87e46fedb813d5b9bf3c685adb8646996ef85e1a18e54888b34fbcc447c0/pylock-0.3.tar.gz" } ] }