{"repo":"hexcowboy/rslock","free":true,"listed":false,"github":"https://github.com/hexcowboy/rslock","clone":"git clone https://github.com/hexcowboy/rslock.git","description":"Distributed locks in async Redis with support for lock extending (Redlock implementation)","language":"Rust","stars":100,"topics":["distributed-lock","dls","redis","redlock","redlock-redis","rust"],"license":"BSD-3-Clause","category":"databases-storage","readme_excerpt":"rslock - Redlock for Redis in Rust [ ][crates.io] [![Docs badge]][docs.rs] This is an implementation of Redlock, the distributed locking mechanism built on top of Redis. Features - Lock extending - Smol and Tokio Redis I/O backends - Async Redis - Redis Cluster support Install [!WARNING] Before release 1.0.0 , this crate will have breaking changes between minor versions. You can upgrade to patch versions without worrying about breaking changes. [!NOTE] The default async-std-comp feature uses Redis's Smol backend with Rustls. The feature name is retained for compatibility. For standalone Redis, you can select Redis's Tokio backend instead by disabling the default features: Build Usage The example below uses Tokio. Select the tokio-comp backend as shown above and add Tokio to your application: More examples: - Basic locking - Creating a manager from Redis clients - Sharing a lock between tasks - Using Redis Cluster Redis Cluster Enable the cluster feature and pass one or more seed-node URIs for one logical cluster. The cluster counts as one backend when rslock calculates quorum: For authentication, TLS, address mapping, and other advanced configuration, build a redis::cluster::ClusterClient and pass it to LockManager::from cluster client . Extending Locks Extending a lock effectively renews its duration instead of adding extra time to it. For instance, if a 1000ms lock is extended by 1000ms after 500ms pass, it will only last for a total of 1500ms, not 2000ms. This approach is ","default_branch":null,"files":null,"tree":[],"storefront":"/r/hexcowboy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hexcowboy/rslock/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}