MCPcopy Index your code
hub / github.com/badboy/redlock-rs

github.com/badboy/redlock-rs @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
29 symbols 87 edges 3 files 6 documented · 21% updated 21mo agov1.0.0 · 2016-01-15★ 582 open issues

Browse by type

Functions 26 Types & classes 3
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

redlock-rs - Distributed locks with Redis

GitHub Workflow Status Crates.io

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:

cargo run --release

Contribute

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

Maintainer

  • From 2014 to June 2021 this crate was owned and maintained by @badboy
  • From June 2021 on this crate is maintained by @aig787

License

BSD. See LICENSE.

Core symbols most depended-on inside this repo

Shape

Function 14
Method 12
Class 3

Languages

Rust100%

Modules by API surface

src/redlock.rs28 symbols
examples/basic.rs1 symbols

For agents

$ claude mcp add redlock-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page