Skip to main content

Distributed lock using Redis

Project description

A distributed lock using Redis. Inspired by Sherlock.

Installation

$ pip install bullock

Usage

from bullock import Bullock
lock = Bullock(host="redis-hostname", key="my-first-lock", ttl=3600)
lock.acquire(blocking=True)
# do critical work here
lock.release()

You can also use the with statement:

from bullock import Bullock
with Bullock(host="redis-hostname", key="my-first-lock", ttl=3600):
    # do critical work here

For more examples, see tests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bullock-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file bullock-0.0.2.tar.gz.

File metadata

  • Download URL: bullock-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bullock-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8b223611451ab7d5de5180cbf44e6d993a09a3da6be557a71c8425997c15fc04
MD5 9346159396ffb225f20848f54c6be5f8
BLAKE2b-256 f3b59402b7797fe102ccdb3cd37d890046431bac3e791fa6e990581b91f6d74f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page