https://github.com/june-it/mystack.distributedlock4redis
Open-source Lightweight Distributed Lock Library (Based on Redis)
https://github.com/june-it/mystack.distributedlock4redis
distributedlock dotnet mystack redis
Last synced: 3 months ago
JSON representation
Open-source Lightweight Distributed Lock Library (Based on Redis)
- Host: GitHub
- URL: https://github.com/june-it/mystack.distributedlock4redis
- Owner: june-it
- License: mit
- Created: 2023-12-09T05:24:41.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-18T10:15:15.000Z (4 months ago)
- Last Synced: 2025-03-18T11:29:51.794Z (4 months ago)
- Topics: distributedlock, dotnet, mystack, redis
- Language: C#
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MyStack.DistributedLock4Redis
Open-source Lightweight Distributed Lock Library (Based on Redis)
| nuget | stats |
| ----------- | ----------- |
| [](https://www.nuget.org/packages/MyStack.DistributedLock4Redis) | [](https://www.nuget.org/stats/packages/MyStack.DistributedLock4Redis?groupby=Version) |# Getting Started
## Add Service Support
```
services.AddDistributedLock4Redis(configure =>
{
configure.KeyPrefix = "MyStack";
configure.ConnectionString = "127.0.0.1:6379,password=123456";
});
```## Using Distributed Locks
```
// Acquire Lock
using (var handle = await distributedLock.TryAcquireAsync("Foo"))
{
if (handle != null)
{
// Write your logical code
}
}
```# License
MIT