Browse Source
Merge pull request #12074 from abpframework/Doc-Dist-Lock
Doc dist lock
pull/12077/head
Halil İbrahim Kalkan
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
17 additions and
13 deletions
-
docs/en/Distributed-Locking.md
|
|
|
@ -27,21 +27,25 @@ using Medallion.Threading.Redis; |
|
|
|
|
|
|
|
namespace AbpDemo |
|
|
|
{ |
|
|
|
public class MyModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var configuration = context.Services.GetConfiguration(); |
|
|
|
|
|
|
|
context.Services.AddSingleton<IDistributedLockProvider>(sp => |
|
|
|
{ |
|
|
|
var connection = ConnectionMultiplexer |
|
|
|
[DependsOn( |
|
|
|
typeof(AbpDistributedLockingModule) |
|
|
|
//If you have the other dependencies, you should do here |
|
|
|
)] |
|
|
|
public class MyModule : AbpModule |
|
|
|
{ |
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var configuration = context.Services.GetConfiguration(); |
|
|
|
|
|
|
|
context.Services.AddSingleton<IDistributedLockProvider>(sp => |
|
|
|
{ |
|
|
|
var connection = ConnectionMultiplexer |
|
|
|
.Connect(configuration["Redis:Configuration"]); |
|
|
|
return new |
|
|
|
return new |
|
|
|
RedisDistributedSynchronizationProvider(connection.GetDatabase()); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
```` |
|
|
|
|
|
|
|
|