A python implementation of redlock, with examples
Project description
# 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
Hungry Hungry Hippos, (HHH) 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
Process isolation
Destributed locks (see https://redis.io/topics/distlock)
Command orchestration
# Toolchain
docker - images, containers, volumes
docker-compose - building, linking services, scaling services
redis - in memory key-value database
# Installation
<code>pip install hungry-hungry-hippos</code>
See examples for use cases
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
Built Distributions
Hashes for hungry_hungry_hippos-0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb59a4df19d89c00e6e2bb6cbc0c9fc7724636ad08fbd4020045d137da34126 |
|
MD5 | 4492bb88b745a0a0333e7a13ed483e14 |
|
BLAKE2b-256 | 118de7cd369aba68cd40bfae4a7bb462df96733141cadcb75d5ab840623c4ef0 |
Hashes for hungry_hungry_hippos-0.7-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8baed22a7cdeed95296fa05acbdb249410241297b8dcbf7ea6b6d858051d839 |
|
MD5 | 00b9cac4a9ad49c1a4c4c15a4098c9f2 |
|
BLAKE2b-256 | 2482f0a8a1a1b870311f40f6a308ace6a637682954986a5f173b23d71aaf23d1 |