forked from sickmartian/quick_simplenote
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: enhance optimistic locking with concurrency support
Introduce a new `OptimisticLockingDict` class that allows for concurrent updates to shared data while ensuring optimistic locking behavior. This addresses the issue of inconsistent updates caused by simultaneous access. The `OptimisticLockingDict` is designed to work with both threading and multiprocessing contexts, providing flexibility and scalability. Its `optimistic_update` method handles concurrent updates by checking for version conflicts and raising an `OptimisticLockingError` if necessary. The inclusion of extensive tests ensures the robustness and correctness of the implementation. This update significantly enhances the ability to manage shared data in multi-threaded and multi-process environments, facilitating robust and reliable data sharing.
- Loading branch information
Showing
1 changed file
with
108 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters