rslock 0.6.0
- Adds support for creating new
LockManager
s from pre-existing Redis clients usingLockManager::from_clients
Sample syntax:
// Create Redis clients
let uris = vec![
"redis://127.0.0.1:6380/",
"redis://127.0.0.1:6381/",
"redis://127.0.0.1:6382/",
];
let clients: Vec<Client> = uris
.iter()
.map(|uri| Client::open(*uri).expect("Failed to create Redis client"))
.collect();
// Initialize the LockManager using `from_clients`
let rl = LockManager::from_clients(clients);
See full example in examples/from_clients.rs