scottbrian-locking


Namescottbrian-locking JSON
Version 2.0.2 PyPI version JSON
download
home_pageNone
SummaryExclusive and shared locking
upload_time2024-06-09 19:11:34
maintainerNone
docs_urlNone
authorNone
requires_python~=3.12
licenseMIT License Copyright (c) [2021] [Scott Tuttle] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords lock blocking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==================
scottbrian-locking
==================

Intro
=====

The SELock is a shared/exclusive lock that you can use to coordinate
read and write access to a resource in a multithreaded application.

:Example: use SELock to coordinate access to a resource

>>> from scottbrian_locking import se_lock as sel
>>> a_lock = sel.SELock()
>>> # Get lock in exclusive mode
>>> with sel.SELockExcl(a_lock):
...     msg = 'lock obtained exclusive'
>>> print(msg)
lock obtained exclusive

>>> # Get lock in shared mode
>>> with sel.SELockShare(a_lock):
...     msg = 'lock obtained shared'
>>> print(msg)
lock obtained shared


.. image:: https://img.shields.io/badge/security-bandit-yellow.svg
    :target: https://github.com/PyCQA/bandit
    :alt: Security Status

.. image:: https://readthedocs.org/projects/pip/badge/?version=stable
    :target: https://pip.pypa.io/en/stable/?badge=stable
    :alt: Documentation Status


Installation
============

Windows:

``pip install scottbrian-locking``


Development setup
=================

See tox.ini

Release History
===============

* 1.0.0
    * Initial release

* 1.1.0
    * Add RELockObtain context manager
    * support python 3.11

* 2.0.0
    * Add obtain_tf to context manager
    * Add allow_recursive_obtain
    * Delete setup.cfg
    * Make consistent log and error messages
    * Support python 3.12
    * Drop support for python < 3.12

* 2.0.1
    * Fix documentation
        * change docs/source/index.rst
        * change docs/requirements.txt
        * change readthedoc.yml

* 2.0.2
    * Fix verify_lock to refresh lock_info
    * Fix thread name in release granted log message

Meta
====

Scott Tuttle

Distributed under the MIT license. See ``LICENSE`` for more information.


Contributing
============

1. Fork it (<https://github.com/yourname/yourproject/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "scottbrian-locking",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.12",
    "maintainer_email": null,
    "keywords": "lock, blocking",
    "author": null,
    "author_email": "Scott Tuttle <sbtuttle@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/bf/d0/810001e96b2008df9a8931ce029888946b6ff03eec7b127ddbc3f0aa9c42/scottbrian_locking-2.0.2.tar.gz",
    "platform": null,
    "description": "==================\r\nscottbrian-locking\r\n==================\r\n\r\nIntro\r\n=====\r\n\r\nThe SELock is a shared/exclusive lock that you can use to coordinate\r\nread and write access to a resource in a multithreaded application.\r\n\r\n:Example: use SELock to coordinate access to a resource\r\n\r\n>>> from scottbrian_locking import se_lock as sel\r\n>>> a_lock = sel.SELock()\r\n>>> # Get lock in exclusive mode\r\n>>> with sel.SELockExcl(a_lock):\r\n...     msg = 'lock obtained exclusive'\r\n>>> print(msg)\r\nlock obtained exclusive\r\n\r\n>>> # Get lock in shared mode\r\n>>> with sel.SELockShare(a_lock):\r\n...     msg = 'lock obtained shared'\r\n>>> print(msg)\r\nlock obtained shared\r\n\r\n\r\n.. image:: https://img.shields.io/badge/security-bandit-yellow.svg\r\n    :target: https://github.com/PyCQA/bandit\r\n    :alt: Security Status\r\n\r\n.. image:: https://readthedocs.org/projects/pip/badge/?version=stable\r\n    :target: https://pip.pypa.io/en/stable/?badge=stable\r\n    :alt: Documentation Status\r\n\r\n\r\nInstallation\r\n============\r\n\r\nWindows:\r\n\r\n``pip install scottbrian-locking``\r\n\r\n\r\nDevelopment setup\r\n=================\r\n\r\nSee tox.ini\r\n\r\nRelease History\r\n===============\r\n\r\n* 1.0.0\r\n    * Initial release\r\n\r\n* 1.1.0\r\n    * Add RELockObtain context manager\r\n    * support python 3.11\r\n\r\n* 2.0.0\r\n    * Add obtain_tf to context manager\r\n    * Add allow_recursive_obtain\r\n    * Delete setup.cfg\r\n    * Make consistent log and error messages\r\n    * Support python 3.12\r\n    * Drop support for python < 3.12\r\n\r\n* 2.0.1\r\n    * Fix documentation\r\n        * change docs/source/index.rst\r\n        * change docs/requirements.txt\r\n        * change readthedoc.yml\r\n\r\n* 2.0.2\r\n    * Fix verify_lock to refresh lock_info\r\n    * Fix thread name in release granted log message\r\n\r\nMeta\r\n====\r\n\r\nScott Tuttle\r\n\r\nDistributed under the MIT license. See ``LICENSE`` for more information.\r\n\r\n\r\nContributing\r\n============\r\n\r\n1. Fork it (<https://github.com/yourname/yourproject/fork>)\r\n2. Create your feature branch (`git checkout -b feature/fooBar`)\r\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\r\n4. Push to the branch (`git push origin feature/fooBar`)\r\n5. Create a new Pull Request\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) [2021] [Scott Tuttle]  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Exclusive and shared locking",
    "version": "2.0.2",
    "project_urls": {
        "Documentation": "https://scottbrian-locking.readthedocs.io/en/latest/",
        "Source": "https://github.com/ScottBrian/scottbrian_locking.git"
    },
    "split_keywords": [
        "lock",
        " blocking"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a970359b2a44ce1ee64b267c8987ecdac390778c2448781c29929ecf8797444",
                "md5": "39909ac3f2d94948af7622f14cb455f3",
                "sha256": "4c0fc449f1e33af513411ca990a89f866a478449fc9f1bb64880cdc1be5688e1"
            },
            "downloads": -1,
            "filename": "scottbrian_locking-2.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "39909ac3f2d94948af7622f14cb455f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.12",
            "size": 14151,
            "upload_time": "2024-06-09T19:11:32",
            "upload_time_iso_8601": "2024-06-09T19:11:32.702653Z",
            "url": "https://files.pythonhosted.org/packages/5a/97/0359b2a44ce1ee64b267c8987ecdac390778c2448781c29929ecf8797444/scottbrian_locking-2.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bfd0810001e96b2008df9a8931ce029888946b6ff03eec7b127ddbc3f0aa9c42",
                "md5": "90ac3d57475cfb6fbe240f31ccdd0405",
                "sha256": "44a889cbb5e4b4e1a3b7e2ddd5498c7307cb97f808848a9ab29f7946569904ab"
            },
            "downloads": -1,
            "filename": "scottbrian_locking-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "90ac3d57475cfb6fbe240f31ccdd0405",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.12",
            "size": 37225,
            "upload_time": "2024-06-09T19:11:34",
            "upload_time_iso_8601": "2024-06-09T19:11:34.703840Z",
            "url": "https://files.pythonhosted.org/packages/bf/d0/810001e96b2008df9a8931ce029888946b6ff03eec7b127ddbc3f0aa9c42/scottbrian_locking-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-09 19:11:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ScottBrian",
    "github_project": "scottbrian_locking",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "scottbrian-locking"
}
        
Elapsed time: 0.26107s