docs.rs failed to build redlock-rs-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: redlock-rs-0.2.1

redlock-rs - Distributed locks with Redis

This is an implementation of Redlock, the distributed locking mechanism built on top of Redis. It is more or less a port of the Ruby version.

It includes a sample application in main.rs.

Build

cargo build --release

Usage

use redlock::RedLock;

fn main() {
  let rl = RedLock::new(vec!["redis://127.0.0.1:6380/", "redis://127.0.0.1:6381/", "redis://127.0.0.1:6382/"]);

  let lock;
  loop {
    match rl.lock("mutex".as_bytes(), 1000) {
      Some(l) => { lock = l; break }
      None => ()
    }
  }

  // Critical section

  rl.unlock(&lock);
}

Tests

Run tests with:

cargo test

Run sample application with:

./target/release/redlock

Contribute

If you find bugs or want to help otherwise, please open an issue.

License

BSD. See LICENSE.