Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/june-it/mystack.distributedlock4redis
开源的轻量级分布式锁类库
https://github.com/june-it/mystack.distributedlock4redis
distributedlock dotnet mystack redis
Last synced: 17 days ago
JSON representation
开源的轻量级分布式锁类库
- Host: GitHub
- URL: https://github.com/june-it/mystack.distributedlock4redis
- Owner: june-it
- License: mit
- Created: 2023-12-09T05:24:41.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-08T08:16:18.000Z (about 1 month ago)
- Last Synced: 2024-11-08T09:22:45.543Z (about 1 month ago)
- Topics: distributedlock, dotnet, mystack, redis
- Language: C#
- Homepage:
- Size: 31.3 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 |
| ----------- | ----------- |
| [![nuget](https://img.shields.io/nuget/v/MyStack.DistributedLock4Redis.svg?style=flat-square)](https://www.nuget.org/packages/MyStack.DistributedLock4Redis) | [![stats](https://img.shields.io/nuget/dt/MyStack.DistributedLock4Redis.svg?style=flat-square)](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