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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for bullock-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2073a481ebb3eb79db6b50f7f776ac2737690716dda216934b145889b3ab5d97
MD5 8fdcd1fdc4ab5c7a152402cd3f263346
BLAKE2b-256 1c74d0ed36f7b6f2d11094aa7c5f26b3b0d4e8015022c9e222e668663bd5dcfd

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