{"id":31793545,"url":"https://github.com/magiclen/rlock","last_synced_at":"2026-01-20T17:31:54.288Z","repository":{"id":316549914,"uuid":"1063838578","full_name":"magiclen/rlock","owner":"magiclen","description":"An easy-to-use Redis-backed lock library providing both async and sync Mutex, RwLock, and others.","archived":false,"fork":false,"pushed_at":"2025-09-25T07:52:59.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-25T09:28:25.685Z","etag":null,"topics":["distributed","mutex","redis","rust","rwlock"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magiclen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-25T07:27:27.000Z","updated_at":"2025-09-25T07:52:54.000Z","dependencies_parsed_at":"2025-09-25T09:28:31.879Z","dependency_job_id":null,"html_url":"https://github.com/magiclen/rlock","commit_stats":null,"previous_names":["magiclen/rlock"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/magiclen/rlock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/rlock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Frlock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004913,"owners_count":26083802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed","mutex","redis","rust","rwlock"],"created_at":"2025-10-10T18:19:43.844Z","updated_at":"2025-10-10T18:19:45.280Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"RLock (Redis Lock)\n====================\n\n[![CI](https://github.com/magiclen/rlock/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/rlock/actions/workflows/ci.yml)\n\nIt is an easy-to-use Redis-backed lock library providing both async and sync Mutex, RwLock, and others.\n\n## Examples\n\n```rust\nuse tokio::task::JoinSet;\nuse rlock::async_lock::RLock;\n\nstatic mut COUNTER: u32 = 0;\n\n#[tokio::main]\nasync fn main() {\n    let rlock = RLock::new(\"redis://127.0.0.1:6379/0\").await.unwrap();\n\n    async fn counter_increase(rlock: RLock) {\n        let lock = rlock.acquire_mutex(\"lock\").await.unwrap();\n\n        // ----- critical section -----\n\n        unsafe { COUNTER += 1 };\n\n        // ----------------------------\n\n        drop(lock);\n    }\n\n    let mut tasks = JoinSet::new();\n\n    for _ in 0..1000 {\n        tasks.spawn(counter_increase(rlock.clone()));\n    }\n\n    tasks.join_all().await;\n\n    assert_eq!(1000, unsafe { COUNTER });\n\n    rlock.shutdown().await;\n}\n```\n\n## Roadmap / TODO\n\n- [x] Asynchronous mutex lock\n- [ ] Synchronous mutex lock\n- [ ] Asynchronous read-write lock\n- [ ] Synchronous read-write lock\n\n## Crates.io\n\nhttps://crates.io/crates/rlock\n\n## Documentation\n\nhttps://docs.rs/rlock\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Frlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Frlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Frlock/lists"}