{"id":28943071,"url":"https://github.com/flixcoder/key-lock","last_synced_at":"2025-10-07T16:45:54.961Z","repository":{"id":65037599,"uuid":"581114337","full_name":"FlixCoder/key-lock","owner":"FlixCoder","description":"Library for mutual exclusion by keys.","archived":false,"fork":false,"pushed_at":"2025-04-06T14:44:38.000Z","size":23,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-23T01:03:55.115Z","etag":null,"topics":["locks","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/key-lock","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FlixCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-22T10:05:35.000Z","updated_at":"2025-04-06T14:44:42.000Z","dependencies_parsed_at":"2023-11-16T18:29:07.787Z","dependency_job_id":"2f0210c4-5977-447e-ad98-efbd378cfc1c","html_url":"https://github.com/FlixCoder/key-lock","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"0f59fc36874c7be468d58980844029d83f1c815b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FlixCoder/key-lock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlixCoder%2Fkey-lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlixCoder%2Fkey-lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlixCoder%2Fkey-lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlixCoder%2Fkey-lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlixCoder","download_url":"https://codeload.github.com/FlixCoder/key-lock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlixCoder%2Fkey-lock/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261416300,"owners_count":23155037,"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","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":["locks","rust"],"created_at":"2025-06-23T04:41:02.795Z","updated_at":"2025-10-07T16:45:54.956Z","avatar_url":"https://github.com/FlixCoder.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KeyLock\n\n[![crates.io page](https://img.shields.io/crates/v/key-lock.svg)](https://crates.io/crates/key-lock)\n[![docs.rs page](https://docs.rs/key-lock/badge.svg)](https://docs.rs/key-lock/)\n![license: MIT](https://img.shields.io/crates/l/key-lock.svg)\n\nSimple library for mutual exclusion based on keys. Lock and wait for execution by key.\n\n## Usage\n\nImport the project using:\n\n```bash\ncargo add key-lock\n```\n\n## Example\n\n```rust\nuse key_lock::KeyLock;\n\n#[tokio::main]\nasync fn main() {\n    // Initialize new lock.\n    let lock = KeyLock::new();\n    // Lock A, continues immediately.\n    let _a = lock.lock(\"a\").await;\n    // Lock B, continues immediately.\n    let _b = lock.lock(\"b\").await;\n    // Try to lock A, but it is already locked. Normal locking would block here.\n    assert!(lock.try_lock(\"a\").await.is_err());\n}\n```\n\n## Minimum supported Rust version\n\nCurrently, I am always using the latest stable Rust version and do not put in effort to keep the MSRV. Please open an issue in case you need a different policy, I might consider changing the policy.\n\n## License\n\nLicensed under the MIT license. All contributors agree to license under this license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflixcoder%2Fkey-lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflixcoder%2Fkey-lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflixcoder%2Fkey-lock/lists"}