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
pip install hungry-hungry-hippos
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 Distribution
Close
Hashes for hungry_hungry_hippos-0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d74eab60daa550b4924563069c6482fcf254648c57c87545b20cfd194cd01673 |
|
MD5 | 9fc07761d01602518208fa0d8cff21dd |
|
BLAKE2b-256 | 185db496c0af139923cbd47f15eeb76593cf72e5c6714f4ead4af11db1ba11ca |