-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: change icon and format code * docs: Add DistributedLocking README * chore: update Masa.Utils library package version to 0.5.0-preview.3 * chore: Add parameter default value * chore: Medalion removes unit tests * docs: Modify readme * chore: Modify readme * chore: Modify readme * chore: Modify readme
- Loading branch information
1 parent
439a601
commit 76b1ec4
Showing
40 changed files
with
899 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Submodule MASA.BuildingBlocks
updated
8 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/Data/DistributedLocking/Masa.Contrib.Data.DistributedLocking.Local/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Local | ||
|
||
## Example: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Local | ||
``` | ||
|
||
1. Modify the class `Program` | ||
|
||
``` C# | ||
builder.Services.AddLocalDistributedLock(); | ||
``` | ||
|
||
2. Use distributed locks | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//Get `IDistributedLock` from DI | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
28 changes: 28 additions & 0 deletions
28
...a/DistributedLocking/Masa.Contrib.Data.DistributedLocking.Local/README.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
中 | [EN](README.md) | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Local | ||
|
||
## 用例: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Local | ||
``` | ||
|
||
1. 修改类`Program` | ||
|
||
``` C# | ||
builder.Services.AddLocalDistributedLock(); | ||
``` | ||
|
||
2. 使用分布式锁 | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//从DI获取`IDistributedLock` | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
31 changes: 31 additions & 0 deletions
31
...stributedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.Azure/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.Azure | ||
|
||
### Example: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.Azure | ||
``` | ||
|
||
1. Modify `Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); | ||
}); | ||
``` | ||
|
||
2. Use distributed locks | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//Get `IDistributedLock` from DI | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
32 changes: 32 additions & 0 deletions
32
...tedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.Azure/README.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
中 | [EN](README.md) | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.Azure | ||
|
||
## 用例: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.Azure | ||
``` | ||
|
||
1. 修改类`Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); | ||
}); | ||
``` | ||
|
||
2. 使用分布式锁 | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//从DI获取`IDistributedLock` | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` | ||
|
31 changes: 31 additions & 0 deletions
31
...utedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem | ||
|
||
### Example: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem | ||
``` | ||
|
||
1. Modify `Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseFileSystem("Replace your directory path"); | ||
}); | ||
``` | ||
|
||
2. Use distributed locks | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//Get `IDistributedLock` from DI | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
32 changes: 32 additions & 0 deletions
32
...cking/Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem/README.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
中 | [EN](README.md) | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem | ||
|
||
## 用例: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.FileSystem | ||
``` | ||
|
||
1. 修改类`Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseFileSystem("Replace your directory path"); | ||
}); | ||
``` | ||
|
||
2. 使用分布式锁 | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//从DI获取`IDistributedLock` | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` | ||
|
31 changes: 31 additions & 0 deletions
31
...stributedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.MySql/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.MySql | ||
|
||
### Example: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.MySql | ||
``` | ||
|
||
1. Modify `Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); | ||
}); | ||
``` | ||
|
||
2. Use distributed locks | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//Get `IDistributedLock` from DI | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
32 changes: 32 additions & 0 deletions
32
...tedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.MySql/README.zh-CN.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
中 | [EN](README.md) | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.MySql | ||
|
||
## 用例: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.MySql | ||
``` | ||
|
||
1. 修改类`Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); | ||
}); | ||
``` | ||
|
||
2. 使用分布式锁 | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//从DI获取`IDistributedLock` | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` | ||
|
31 changes: 31 additions & 0 deletions
31
...tributedLocking/Masa.Contrib.Data.DistributedLocking.Medallion.Oracle/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Masa.Contrib.Data.DistributedLocking.Medallion.Oracle | ||
|
||
### Example: | ||
|
||
```c# | ||
Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.Oracle | ||
``` | ||
|
||
1. Modify `Program` | ||
|
||
``` C# | ||
builder.Services.AddDistributedLock(medallionBuilder => | ||
{ | ||
medallionBuilder.UseOracle("Data Source=MyOracleDB;Integrated Security=yes;"); | ||
}); | ||
``` | ||
|
||
2. Use distributed locks | ||
|
||
``` C# | ||
IDistributedLock distributedLock;//Get `IDistributedLock` from DI | ||
using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) | ||
{ | ||
if (lockObj != null) | ||
{ | ||
// todo: The code that needs to be executed after acquiring the distributed lock | ||
} | ||
} | ||
``` |
Oops, something went wrong.