Metadata-Version: 2.1
Name: door
Version: 0.0.4
Summary: A comprehensive python library for synchronization proxies
Home-page: https://github.com/blueskysolarracing/door
Author: Blue Sky Solar Racing
Author-email: blueskysolar@studentorg.utoronto.ca
License: MIT
Project-URL: Documentation, https://door.readthedocs.io/en/latest/
Project-URL: Source, https://github.com/blueskysolarracing/door
Project-URL: Tracker, https://github.com/blueskysolarracing/door/issues
Keywords: python,synchronization
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Education
Classifier: Topic :: Scientific/Engineering
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/x-rst
License-File: LICENSE

====
Door
====

Door is a comprehensive python library for synchronization proxies. Door's
reliability has been established through static type checking, extensive
doctests, and unit tests, achieving 93% code coverage.


Features
--------

- Share objects across processes without queues or pipes.
- Synchronization proxies to enforce sound synchronous data access.

  - Supported scenarios:
  
    - Threading;
    - Multiprocessing;
    - Asynchronous programming.

- Shared lock (Readers-writer lock) implementations.
- Shared condition variable (Readers-writer condition variables)
  implementations.

Installation
------------

.. code-block:: bash

   pip install door

Usage
-----

Below shows a sample usage of Door.

.. code-block:: pycon

   >>> from dataclasses import dataclass
   >>> from multiprocessing import Process
   >>> from door.multiprocessing2 import Handle, SAcquirableDoor
   >>> @dataclass
   ... class Resource:
   ...     key: str = 'value'
   ... 
   >>> handle = Handle(Resource())
   >>> handle.get()
   Resource(key='value')
   >>> door = SAcquirableDoor(handle)
   >>> def func(door):
   ...     with door.write() as proxy:
   ...         proxy.key = 'VALUE'
   ... 
   >>> process = Process(target=func, args=(door,))
   >>> process.start()
   >>> process.join()
   >>> handle.get()
   Resource(key='VALUE')
   >>> handle.unlink()

Testing and Validation
----------------------

Door has extensive test coverage, passes mypy static type checking with
strict parameter, and has been validated through extensive use in real-life
scenarios.

Contributing
------------

Contributions are welcome! Please read our Contributing Guide for more
information.

License
-------

Door is distributed under the MIT license.
