{ "info": { "author": "Cameron Simpson", "author_email": "cs@cskk.id.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "*Latest release 20190923.2*:\nFix annoying docstring typo.\n\nThread related convenience classes and functions.\n\n## Class `AdjustableSemaphore`\n\nA semaphore whose value may be tuned after instantiation.\n\n## Function `bg(func, daemon=None, name=None, no_start=False, no_logexc=False, args=None, kwargs=None)`\n\nDispatch the callable `func` in its own `Thread`;\nreturn the `Thread`.\n\nParameters:\n* `func`: a callable for the `Thread` target.\n* `daemon`: optional argument specifying the `.daemon` attribute.\n* `name`: optional argument specifying the `Thread` name,\n default: the name of `func`.\n* `no_start`: optional argument, default `False`.\n If true, do not start the `Thread`.\n* `no_logexc`: if false (default `False`), wrap `func` in `@logexc`.\n* `args`, `kwargs`: passed to the `Thread` constructor\n\n## Class `LockableMixin`\n\nTrite mixin to control access to an object via its ._lock attribute.\nExposes the ._lock as the property .lock.\nPresents a context manager interface for obtaining an object's lock.\n\n## Function `locked(func)`\n\nA decorator for monitor functions that must run within a lock.\nRelies upon a ._lock attribute for locking.\n\n## Function `locked_property(func, lock_name='_lock', prop_name=None, unset_object=None)`\n\nA thread safe property whose value is cached.\nThe lock is taken if the value needs to computed.\n\n## Class `PriorityLock`\n\nA priority based mutex which is acquired by and released to waiters\nin priority order.\n\nThe initialiser sets a default priority, itself defaulting to `0`.\n\nThe `acquire()` method accepts an optional `priority` value\nwhich specifies the priority of the acquire request;\nlower values have higher priorities.\n`acquire` returns a new `PriorityLockSubLock`.\n\nNote that internally this allocates a `threading.Lock` per acquirer.\n\nWhen `acquire` is called, if the `PriorityLock` is taken\nthen the acquirer blocks on their personal `Lock`.\n\nWhen `release()` is called the highest priority `Lock` is released.\n\nWithin a priority level `acquire`s are served in FIFO order.\n\nUsed as a context manager, the mutex is obtained at the default priority.\nThe `priority()` method offers a context manager\nwith a specified priority.\nBoth context managers return the `PriorityLockSubLock`\nallocated by the `acquire`.\n\n### Method `PriorityLock.__init__(self, default_priority=0, name=None)`\n\nInitialise the `PriorityLock`.\n\nParameters:\n* `default_priority`: the default `acquire` priority,\n default `0`.\n* `name`: optional identifying name\n\n## Class `PriorityLockSubLock`\n\nMRO: `PriorityLockSubLock`, `builtins.tuple` \nThe record for the per-`acquire`r `Lock` held by `PriorityLock.acquire`.\n\n## Function `via(cmanager, func, *a, **kw)`\n\nReturn a callable that calls the supplied `func` inside a\nwith statement using the context manager `cmanager`.\nThis intended use case is aimed at deferred function calls.\n\n## Class `WorkerThreadPool`\n\nMRO: `cs.resources.MultiOpenMixin` \nA pool of worker threads to run functions.\n\n### Method `WorkerThreadPool.__init__(self, name=None, max_spare=4)`\n\nInitialise the WorkerThreadPool.\n\nParameters:\n* `name`: optional name for the pool\n* `max_spare`: maximum size of each idle pool (daemon and non-daemon)\n\n## Class `WTPoolEntry`\n\nMRO: `builtins.tuple` \nWTPoolEntry(thread, queue)\n\n\n\n# Release Log\n\n*Release 20190923.2*:\nFix annoying docstring typo.\n\n*Release 20190923.1*:\nDocstring updates.\n\n*Release 20190923*:\nRemove dependence on cs.obj.\n\n*Release 20190921*:\nNew PriorityLock class for a mutex which releases in (priority,fifo) order.\n\n*Release 20190812*:\nbg: compute default name before wrapping `func` in @logexc.\n\n*Release 20190729*:\nbg: provide default `name`, run callable inside Pfx, add optional no_logexc=False param preventing @logec wrapper if true.\n\n*Release 20190422*:\nbg(): new optional `no_start=False` keyword argument, preventing Thread.start if true\n\n*Release 20190102*:\nDrop some unused classes.\nNew LockableMixin, presenting a context manager and a .lock property.\n\n*Release 20160828*:\nUse \"install_requires\" instead of \"requires\" in DISTINFO.\n\n*Release 20160827*:\nReplace bare \"excepts\" with \"except BaseException\".\nDoc updates. Other minor improvements.\n\n*Release 20150115*:\nFirst PyPI release.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/cameron_simpson/css/commits/all", "keywords": "python2,python3", "license": "GNU General Public License v3 or later (GPLv3+)", "maintainer": "", "maintainer_email": "", "name": "cs.threads", "package_url": "https://pypi.org/project/cs.threads/", "platform": "", "project_url": "https://pypi.org/project/cs.threads/", "project_urls": { "Homepage": "https://bitbucket.org/cameron_simpson/css/commits/all" }, "release_url": "https://pypi.org/project/cs.threads/20190923.2/", "requires_dist": null, "requires_python": "", "summary": "threading and communication/synchronisation conveniences", "version": "20190923.2" }, "last_serial": 5870728, "releases": { "20150115": [ { "comment_text": "", "digests": { "md5": "0e894298843639ef464cc1315f30f516", "sha256": "dcdc4bdf72755c667fb7e186773031af36a88e94d642e38124418b600233c197" }, "downloads": -1, "filename": "cs.threads-20150115.tar.gz", "has_sig": false, "md5_digest": "0e894298843639ef464cc1315f30f516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5329, "upload_time": "2015-01-18T06:13:28", "url": "https://files.pythonhosted.org/packages/b8/89/93a1dec9db3507056e7558e6c23cab477cead2a3ae6b86373cb8d44722b4/cs.threads-20150115.tar.gz" } ], "20160827": [ { "comment_text": "", "digests": { "md5": "12bba9988b8427e987bc18e13bbd9ca6", "sha256": "5c22a1e080c5b74ffaa9b6c6a86c5a3cfac9c52d39bb27c88b8f75c9541ad3b7" }, "downloads": -1, "filename": "cs.threads-20160827.tar.gz", "has_sig": false, "md5_digest": "12bba9988b8427e987bc18e13bbd9ca6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5711, "upload_time": "2016-08-27T03:27:35", "url": "https://files.pythonhosted.org/packages/22/11/cb1b87e4d453cf52e676271c1f6ad32749a74918138da73abcd27c0a8182/cs.threads-20160827.tar.gz" } ], "20160828": [ { "comment_text": "", "digests": { "md5": "899e396bb75d64f8b6f5f955b33d16ae", "sha256": "bafac01073f02306504599c72926a703303389f6630aa7b8dabb7e708170939d" }, "downloads": -1, "filename": "cs.threads-20160828.tar.gz", "has_sig": false, "md5_digest": "899e396bb75d64f8b6f5f955b33d16ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6067, "upload_time": "2016-08-28T06:11:47", "url": "https://files.pythonhosted.org/packages/09/73/efee873c1cac8d0bc2a9a3cc7feabe22bf30250ca7df6dc9cd6433841b00/cs.threads-20160828.tar.gz" } ], "20190102": [ { "comment_text": "", "digests": { "md5": "258c63e7236ab9057a9e553ab181ddd7", "sha256": "e6b8b21d63b7fd1a7749cbb3efd3c049092fcbc831454cbb7b95573e3dc977ee" }, "downloads": -1, "filename": "cs.threads-20190102.tar.gz", "has_sig": false, "md5_digest": "258c63e7236ab9057a9e553ab181ddd7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5298, "upload_time": "2019-01-02T09:27:47", "url": "https://files.pythonhosted.org/packages/6f/ce/6decb7a1ca1f4dbb4ffe0ffd5c1611a702f6cc92b5a2ea81f999a4514114/cs.threads-20190102.tar.gz" } ], "20190422": [ { "comment_text": "", "digests": { "md5": "5ffbfd1b9d898a295f09b6802cc83a54", "sha256": "42ad8439751012b6c080bb8354118a263a4ffc68f377685eb4cc5511b22abdfe" }, "downloads": -1, "filename": "cs.threads-20190422.tar.gz", "has_sig": false, "md5_digest": "5ffbfd1b9d898a295f09b6802cc83a54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5502, "upload_time": "2019-04-22T08:53:01", "url": "https://files.pythonhosted.org/packages/85/37/bf26c82547804db39ac967f1babf1c7649a6b5e031e362fe971f4d04cabf/cs.threads-20190422.tar.gz" } ], "20190729": [ { "comment_text": "", "digests": { "md5": "c2d4000c2336304e70134911330e3720", "sha256": "71b9fd278dd016d5e7b5e1a571bfe47a8daa2d91f69c38b464b01898e20a500d" }, "downloads": -1, "filename": "cs.threads-20190729.tar.gz", "has_sig": false, "md5_digest": "c2d4000c2336304e70134911330e3720", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5648, "upload_time": "2019-07-28T23:24:03", "url": "https://files.pythonhosted.org/packages/b5/3e/25ef0bb0266815f81d9b1989c2338324fffc0901b0818ad3a5c036f16b00/cs.threads-20190729.tar.gz" } ], "20190812": [ { "comment_text": "", "digests": { "md5": "91cac9461e7e75e4d2d3c2d07dff3309", "sha256": "c606eed63a585d2c3e31ceef865d00dd2cbdb071acd01e1222d8b7a0c89365b7" }, "downloads": -1, "filename": "cs.threads-20190812.tar.gz", "has_sig": false, "md5_digest": "91cac9461e7e75e4d2d3c2d07dff3309", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6099, "upload_time": "2019-08-11T23:31:57", "url": "https://files.pythonhosted.org/packages/d8/4d/7b9e21fb6c0efae75e98a4a1b8580bc1a8f8c0ee9c245002f37f2555aae5/cs.threads-20190812.tar.gz" } ], "20190923": [ { "comment_text": "", "digests": { "md5": "38f2968a93c672b2e16f2306ae47756e", "sha256": "e8e52952e582da2380da2937bdfc7ad7a2219e89d7832255ae45ee173f2f28ce" }, "downloads": -1, "filename": "cs.threads-20190923.tar.gz", "has_sig": false, "md5_digest": "38f2968a93c672b2e16f2306ae47756e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7909, "upload_time": "2019-09-22T23:05:34", "url": "https://files.pythonhosted.org/packages/5f/ee/47f621b1b4cceaf9b402e79ff01802b5e19963bee732f9b4b6b6acdbc028/cs.threads-20190923.tar.gz" } ], "20190923.1": [ { "comment_text": "", "digests": { "md5": "6ee096ad21cb6808d5c4754bd1b7665f", "sha256": "051f936c2fda7beb354dc1b7cdcd4e1bbf736f67c7658ae5d7169629e762cabb" }, "downloads": -1, "filename": "cs.threads-20190923.1.tar.gz", "has_sig": false, "md5_digest": "6ee096ad21cb6808d5c4754bd1b7665f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8100, "upload_time": "2019-09-22T23:12:26", "url": "https://files.pythonhosted.org/packages/fe/7d/102a9cdbef08d80a205000d457a3c8bdda424f2716a1c40b12dede445bac/cs.threads-20190923.1.tar.gz" } ], "20190923.2": [ { "comment_text": "", "digests": { "md5": "cf4ba1f0dab17c5171ec140085f472ec", "sha256": "89937338126d3b936b20aa68d53cc8b54e1b2329e067074f4c4afac4c1fa1743" }, "downloads": -1, "filename": "cs.threads-20190923.2.tar.gz", "has_sig": false, "md5_digest": "cf4ba1f0dab17c5171ec140085f472ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8800, "upload_time": "2019-09-22T23:14:06", "url": "https://files.pythonhosted.org/packages/06/45/7a622c33fa56867cfaf13f09766aeeb95c6f4b1bdc7c0d732f9143c71dcd/cs.threads-20190923.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cf4ba1f0dab17c5171ec140085f472ec", "sha256": "89937338126d3b936b20aa68d53cc8b54e1b2329e067074f4c4afac4c1fa1743" }, "downloads": -1, "filename": "cs.threads-20190923.2.tar.gz", "has_sig": false, "md5_digest": "cf4ba1f0dab17c5171ec140085f472ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8800, "upload_time": "2019-09-22T23:14:06", "url": "https://files.pythonhosted.org/packages/06/45/7a622c33fa56867cfaf13f09766aeeb95c6f4b1bdc7c0d732f9143c71dcd/cs.threads-20190923.2.tar.gz" } ] }