Skip to content

rslock 0.6.0

Compare
Choose a tag to compare
@hexcowboy hexcowboy released this 18 Nov 02:48
· 1 commit to main since this release
f7ca9f7
  • Adds support for creating new LockManagers from pre-existing Redis clients using LockManager::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