Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
The combo-lock is a combination of a process lock and a thread lock. Usable in cases both multiple threads and multiple processes are sharing the same resource such as a file in the file system.
The module utilizes the FileLock from filelock and the standard Lock from threading.
The FileLock uses a filesystem lock so the initialization of the class requires a path for the lock file.
from combo_lock import ComboLock
lock = ComboLock('/tmp/my.lock')
with lock:
write_my_shared_resource()
A NamedLock
will save the lock file to shared memory using memory-tempfile
from combo_lock import NamedLock
lock = NamedLock('some_name')
with lock:
write_my_shared_resource()
The combo-lock was originally created for Mycroft-core but as it's been useful in other projects a separate release seemed appropriate.
FAQs
A combined process and thread lock
We found that combo-lock demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.