Skip to main content

Use cases

  • Got a script that you want to be able to run multiple instances of in parallel?
  • Want to write a program from scratch that's ready to scale up?
  • Using someone else's code that has race conditions and want to singleton-ize it?

Intro

dredlock is a python implementation of redlock https://redis.io/topics/distlock with a set of examples that use docker, redis and docker compose. The advantage of this approch, compared to multithreading, is that is can be applied in a single-threaded context (for example if you have to integrate existing code), or in a mutliple container instance context (think microservices)

Features

  • atomic locking guarantees single lock acquisition
  • works across machines / containers
  • handles dead lock recovery
  • can wrap existing code for cases when you cannot or do not want to do a rewrite.

Key concepts

Toolchain

  • docker - images, containers, volumes
  • docker-compose - building, linking services, scaling services
  • redis - in memory key-value database

Installation

pip install dredlock

See examples for use cases

Metadata

Release files for dredlock 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dredlock 1.0
File Size Uploaded Provenance Actions
dredlock-1.0.tar.gz 2.1 kB Without provenance Details for dredlock-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dredlock 1.0
File Interpreter ABI Platform Actions
dredlock-1.0-py3-none-any.whl Python 3 none any Details for dredlock-1.0-py3-none-any.whl

Total release size: 3.8 kB

Release files / dredlock-1.0.tar.gz

Download URL dredlock-1.0.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b8afd2d4e5b5464daa903986b80307a996fbb6c1015470b7f249d7fff7ec40ec
BLAKE2b-256 checksum
How to use checksums
4b6b1b35cd06bcec18204f1b954c73175712b0e837026466a00ec962e7a740e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.12

Release files / dredlock-1.0-py3-none-any.whl

Download URL dredlock-1.0-py3-none-any.whl
Size 1.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a3216868e7a3fec6ad646a2dd64a35fd6be55ad14c8351c7e5a391e907242b3
BLAKE2b-256 checksum
How to use checksums
36123b8d87cbc8b1f40b788c372933cc4b7e7d5856c3d7ccd6e3975ba5bb6338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.12

Security for dredlock 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page