Skip to main content

Distributed lock using Redis

Project description

A distributed lock using Redis. Inspired by Sherlock.

https://travis-ci.org/jbochi/bullock.svg?branch=master

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.4.tar.gz (2.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for bullock-0.0.4.tar.gz
Algorithm Hash digest
SHA256 4f8ba099aff649aa1c35fafaf31c1179c81322e90bf891fc20021ac5a92f0e9c
MD5 fd969b3ceac21d869902aaf348b46999
BLAKE2b-256 112cd5c2cff59aabb44c99c2076e8ed15358ea089c2df6df32a3c50e35813a12

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