redis-lock

Crates.ioredis-lock
lib.rsredis-lock
version0.5.1
sourcesrc
created_at2024-10-22 16:11:02.308022
updated_at2024-11-24 14:26:28.88631
descriptionRusty distributed locking backed by Redis.
homepage
repositoryhttps://github.com/JonathanWoollett-Light/redis-lock
max_upload_size
id1418889
size82,356
Jonathan Woollett-Light (JonathanWoollett-Light)

documentation

https://docs.rs/redis-lock/

README

redis-lock

Crates.io docs

Rusty distributed locking backed by Redis.

// Setup.
redis_lock::setup(&client).await?;
// Get lock.
let mut lock = redis_lock::MultiResourceLock::new(client.clone())?;
let resources = vec![String::from("account1"), String::from("account2")];
// Execute a function with the lock.
lock.map_default(&resources, async move { /* .. */ }).await?;

Vs rslock

I would recommend this library over rslock when your application does operations that require exclusive access to multiple resources.

Similar work

Commit count: 21

cargo fmt