Skip to content

leandromoreira/bullock

 
 

Repository files navigation

Bullock

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.

About

Distributed lock for Python using Redis

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%