From 4aad8295cb4e0b656cbda83eb073387f60a8051a Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 08:58:19 +0300 Subject: [PATCH 1/8] docs: add background jobs section and update navigation links --- .../background-jobs.md | 19 +++++++++++++++++++ .../single-layer-web-application/index.md | 2 ++ .../swagger-integration.md | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 docs/en/solution-templates/single-layer-web-application/background-jobs.md diff --git a/docs/en/solution-templates/single-layer-web-application/background-jobs.md b/docs/en/solution-templates/single-layer-web-application/background-jobs.md new file mode 100644 index 0000000000..1a3d592a5e --- /dev/null +++ b/docs/en/solution-templates/single-layer-web-application/background-jobs.md @@ -0,0 +1,19 @@ +# Single Layer Solution: Background Jobs + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Swagger integration", + "Path": "solution-templates/single-layer-web-application/swagger-integration" + }, + "Next": { + "Name": "Background Workers", + "Path": "solution-templates/single-layer-web-application/background-workers" + } +} +``` + +Background jobs are long-running, asynchronous tasks that run in the background of your application. They are useful for tasks that are not time-sensitive, such as sending emails, generating reports, or processing data. Background jobs are typically triggered by a user action or a scheduled task. You can learn more about background jobs in the [Background Jobs](../../framework/infrastructure/background-jobs/index.md) document. + +In the Single Layer solution template, background jobs are implemented using the [Background Jobs](../../modules/background-jobs.md) module. This module provides a simple and efficient way to create and manage background jobs in your application. It includes features such as job queues, job scheduling. It stores job information in the database, allowing you to track the status of jobs and retry failed jobs. \ No newline at end of file diff --git a/docs/en/solution-templates/single-layer-web-application/index.md b/docs/en/solution-templates/single-layer-web-application/index.md index e83100e7cf..be7908d87b 100644 --- a/docs/en/solution-templates/single-layer-web-application/index.md +++ b/docs/en/solution-templates/single-layer-web-application/index.md @@ -28,6 +28,8 @@ ABP Studio offers pre-architected, production-ready templates to quickly start a * [Database configurations](database-configurations.md) * [Logging (with Serilog)](logging.md) * [Swagger integration](swagger-integration.md) + * [Bacground Jobs](background-jobs.md) + * [Background Workers](background-workers.md) * [Multi-Tenancy](multi-tenancy.md) * [BLOB storing](blob-storing.md) * [CORS configuration](cors-configuration.md) \ No newline at end of file diff --git a/docs/en/solution-templates/single-layer-web-application/swagger-integration.md b/docs/en/solution-templates/single-layer-web-application/swagger-integration.md index bd6ddcf584..6de24705ee 100644 --- a/docs/en/solution-templates/single-layer-web-application/swagger-integration.md +++ b/docs/en/solution-templates/single-layer-web-application/swagger-integration.md @@ -8,8 +8,8 @@ "Path": "solution-templates/single-layer-web-application/logging" }, "Next": { - "Name": "Multi-Tenancy", - "Path": "solution-templates/single-layer-web-application/multi-tenancy" + "Name": "Background Jobs", + "Path": "solution-templates/single-layer-web-application/background-jobs" } } ``` From 18ad8548a83858c1b5db750cc2f02884031b4764 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 10:31:53 +0300 Subject: [PATCH 2/8] docs: add background workers documentation for single layer solution --- .../background-workers.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/en/solution-templates/single-layer-web-application/background-workers.md diff --git a/docs/en/solution-templates/single-layer-web-application/background-workers.md b/docs/en/solution-templates/single-layer-web-application/background-workers.md new file mode 100644 index 0000000000..a41f795c88 --- /dev/null +++ b/docs/en/solution-templates/single-layer-web-application/background-workers.md @@ -0,0 +1,19 @@ +# Single Layer Solution: Background Workers + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Background Jobs", + "Path": "solution-templates/single-layer-web-application/background-jobs" + }, + "Next": { + "Name": "Multi-Tenancy", + "Path": "solution-templates/single-layer-web-application/multi-tenancy" + } +} +``` + +Background workers are long-running processes that run in the background of your application. They are useful for tasks that are not time-sensitive, such as processing data, sending notifications, or monitoring system health. Background workers are typically started when the application starts and run continuously until the application stops. You can learn more about background workers in the [Background Workers](../../framework/infrastructure/background-workers/index.md) document. + +> When scaling out your application in a distributed system, it's crucial to consider that the same background workers might run on multiple instances of the same service. This requires careful management of potential side effects. For example, if you're processing messages from a queue, you need to ensure that each message is processed only once. To prevent multiple instances from handling the same message, you can use [distributed locking](../../framework/infrastructure/distributed-locking.md). From af36d685d49b3a4051552c16b82b065d3983aa73 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 10:40:25 +0300 Subject: [PATCH 3/8] docs: enhance background workers documentation with example and registration details --- .../background-workers.md | 44 +++++++++++++++++++ .../multi-tenancy.md | 4 +- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/docs/en/solution-templates/single-layer-web-application/background-workers.md b/docs/en/solution-templates/single-layer-web-application/background-workers.md index a41f795c88..6b9a3b3dc1 100644 --- a/docs/en/solution-templates/single-layer-web-application/background-workers.md +++ b/docs/en/solution-templates/single-layer-web-application/background-workers.md @@ -16,4 +16,48 @@ Background workers are long-running processes that run in the background of your application. They are useful for tasks that are not time-sensitive, such as processing data, sending notifications, or monitoring system health. Background workers are typically started when the application starts and run continuously until the application stops. You can learn more about background workers in the [Background Workers](../../framework/infrastructure/background-workers/index.md) document. +Basically, you can create scheduled workers for a specific time interval based on your requirements, such as checking the status of inactive users and changing their status to passive if they have not logged in to the application in the last 30 days. + +```csharp +public class PassiveUserCheckerWorker : AsyncPeriodicBackgroundWorkerBase +{ + public PassiveUserCheckerWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory) : base( + timer, + serviceScopeFactory) + { + Timer.Period = 600000; //10 minutes + } + + protected async override Task DoWorkAsync( + PeriodicBackgroundWorkerContext workerContext) + { + Logger.LogInformation("Starting: Setting status of inactive users..."); + + // Resolve dependencies + var userRepository = workerContext + .ServiceProvider + .GetRequiredService(); + + // Do the work + await userRepository.UpdateInactiveUserStatusesAsync(); + + Logger.LogInformation("Completed: Setting status of inactive users..."); + } +} +``` + +After creating a worker, we should also register it in the related microservice or project. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. + +```csharp +public class BookstoreModule : AbpModule +{ + public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + await context.AddBackgroundWorkerAsync(); + } +} +``` + > When scaling out your application in a distributed system, it's crucial to consider that the same background workers might run on multiple instances of the same service. This requires careful management of potential side effects. For example, if you're processing messages from a queue, you need to ensure that each message is processed only once. To prevent multiple instances from handling the same message, you can use [distributed locking](../../framework/infrastructure/distributed-locking.md). diff --git a/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md b/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md index 452cfa9bcd..8a9a9be41f 100644 --- a/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md +++ b/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md @@ -4,8 +4,8 @@ //[doc-nav] { "Previous": { - "Name": "Swagger integration", - "Path": "solution-templates/single-layer-web-application/swagger-integration" + "Name": "Background Workers", + "Path": "solution-templates/single-layer-web-application/background-workers" }, "Next": { "Name": "BLOB storing", From 11e028a0eb9106f1aa8252bd19e64c84bb7a8e28 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 10:47:47 +0300 Subject: [PATCH 4/8] docs: add background jobs documentation and update navigation links --- .../background-jobs.md | 19 +++++++++++++++++++ .../layered-web-application/index.md | 2 ++ .../swagger-integration.md | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 docs/en/solution-templates/layered-web-application/background-jobs.md diff --git a/docs/en/solution-templates/layered-web-application/background-jobs.md b/docs/en/solution-templates/layered-web-application/background-jobs.md new file mode 100644 index 0000000000..beef27d5d0 --- /dev/null +++ b/docs/en/solution-templates/layered-web-application/background-jobs.md @@ -0,0 +1,19 @@ +# Layered Solution: Background Jobs + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Swagger integration", + "Path": "solution-templates/layered-web-application/swagger-integration" + }, + "Next": { + "Name": "Background Workers", + "Path": "solution-templates/layered-web-application/background-workers" + } +} +``` + +Background jobs are long-running, asynchronous tasks that operate in the background of your application. They are ideal for non-time-sensitive tasks, such as sending emails, generating reports, or processing data. These jobs are usually triggered by a user action or a scheduled task. For more information, refer to the [Background Jobs](../../framework/infrastructure/background-jobs/index.md) document. + +In the layered solution template, background jobs are implemented using the [Background Jobs](../../modules/background-jobs.md) module. This module offers a simple and efficient way to create and manage background jobs in your application. It provides features like job queues and job scheduling. Job information is stored in the database, enabling you to track job statuses and retry failed jobs. \ No newline at end of file diff --git a/docs/en/solution-templates/layered-web-application/index.md b/docs/en/solution-templates/layered-web-application/index.md index d579b317b0..0c2e4fdef0 100644 --- a/docs/en/solution-templates/layered-web-application/index.md +++ b/docs/en/solution-templates/layered-web-application/index.md @@ -29,6 +29,8 @@ ABP Studio provides pre-architected, production-ready templates to jump-start a * [Database configurations](database-configurations.md) * [Logging (with Serilog)](logging.md) * [Swagger integration](swagger-integration.md) + * [Bacground Jobs](background-jobs.md) + * [Background Workers](background-workers.md) * [Multi-Tenancy](multi-tenancy.md) * [BLOB storing](blob-storing.md) * [CORS configuration](cors-configuration.md) diff --git a/docs/en/solution-templates/layered-web-application/swagger-integration.md b/docs/en/solution-templates/layered-web-application/swagger-integration.md index 049c30edc7..202ab9f892 100644 --- a/docs/en/solution-templates/layered-web-application/swagger-integration.md +++ b/docs/en/solution-templates/layered-web-application/swagger-integration.md @@ -8,8 +8,8 @@ "Path": "solution-templates/layered-web-application/logging" }, "Next": { - "Name": "Multi-Tenancy", - "Path": "solution-templates/layered-web-application/multi-tenancy" + "Name": "Background Jobs", + "Path": "solution-templates/layered-web-application/background-jobs" } } ``` From ce9e47a132222b3c57f55a7ae0273aecc56969c7 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 11:22:05 +0300 Subject: [PATCH 5/8] docs: add background workers documentation for layered solution and update navigation links --- .../background-workers.md | 63 +++++++++++++++++++ .../layered-web-application/multi-tenancy.md | 4 +- .../background-workers.md | 2 +- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 docs/en/solution-templates/layered-web-application/background-workers.md diff --git a/docs/en/solution-templates/layered-web-application/background-workers.md b/docs/en/solution-templates/layered-web-application/background-workers.md new file mode 100644 index 0000000000..61f766abd5 --- /dev/null +++ b/docs/en/solution-templates/layered-web-application/background-workers.md @@ -0,0 +1,63 @@ +# Layered Solution: Background Workers + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Background Jobs", + "Path": "solution-templates/layered-web-application/background-jobs" + }, + "Next": { + "Name": "Multi-Tenancy", + "Path": "solution-templates/layered-web-application/multi-tenancy" + } +} +``` + +Background workers are long-running processes that operate in the background of your application. They are ideal for non-time-sensitive tasks, such as processing data, sending notifications, or monitoring system health. Typically, background workers start when the application launches and run continuously until the application stops. For more information, refer to the [Background Workers](../../framework/infrastructure/background-workers/index.md) document. + +Basically, you can create scheduled workers to run at specific time intervals based on your requirements. For example, you might create a worker to check the status of inactive users and change their status to passive if they haven't logged in to the application in the last 30 days. + +```csharp +public class PassiveUserCheckerWorker : AsyncPeriodicBackgroundWorkerBase +{ + public PassiveUserCheckerWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory) : base( + timer, + serviceScopeFactory) + { + Timer.Period = 600000; //10 minutes + } + + protected async override Task DoWorkAsync( + PeriodicBackgroundWorkerContext workerContext) + { + Logger.LogInformation("Starting: Setting status of inactive users..."); + + // Resolve dependencies + var userRepository = workerContext + .ServiceProvider + .GetRequiredService(); + + // Do the work + await userRepository.UpdateInactiveUserStatusesAsync(); + + Logger.LogInformation("Completed: Setting status of inactive users..."); + } +} +``` + +After creating a worker, we should also register it in the application. We might add it in the *Domain* or *Application* layer. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. + +```csharp +public class BookstoreApplicationModule : AbpModule +{ + public override async Task OnApplicationInitializationAsync(ApplicationInitializationContext context) + { + await context.AddBackgroundWorkerAsync(); + } +} +``` + +> When scaling out your application in a distributed system, it's crucial to consider that the same background workers might run on multiple instances of the same service. This requires careful management of potential side effects. For example, if you're processing messages from a queue, you need to ensure that each message is processed only once. To prevent multiple instances from handling the same message, you can use [distributed locking](../../framework/infrastructure/distributed-locking.md). diff --git a/docs/en/solution-templates/layered-web-application/multi-tenancy.md b/docs/en/solution-templates/layered-web-application/multi-tenancy.md index 53727f1c85..4011535d4d 100644 --- a/docs/en/solution-templates/layered-web-application/multi-tenancy.md +++ b/docs/en/solution-templates/layered-web-application/multi-tenancy.md @@ -4,8 +4,8 @@ //[doc-nav] { "Previous": { - "Name": "Swagger integration", - "Path": "solution-templates/layered-web-application/swagger-integration" + "Name": "Background Workers", + "Path": "solution-templates/layered-web-application/background-workers" }, "Next": { "Name": "BLOB storing", diff --git a/docs/en/solution-templates/single-layer-web-application/background-workers.md b/docs/en/solution-templates/single-layer-web-application/background-workers.md index 6b9a3b3dc1..7075d85879 100644 --- a/docs/en/solution-templates/single-layer-web-application/background-workers.md +++ b/docs/en/solution-templates/single-layer-web-application/background-workers.md @@ -48,7 +48,7 @@ public class PassiveUserCheckerWorker : AsyncPeriodicBackgroundWorkerBase } ``` -After creating a worker, we should also register it in the related microservice or project. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. +After creating a worker, we should also register it in the application. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. ```csharp public class BookstoreModule : AbpModule From ca6e427eebb32855d1aa616805dc2bb01a11f396 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 15:51:36 +0300 Subject: [PATCH 6/8] docs: add distributed locking documentation and update navigation links --- .../background-workers.md | 4 +- .../distributed-locking.md | 44 +++++++++++++++++++ .../single-layer-web-application/index.md | 1 + .../multi-tenancy.md | 4 +- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 docs/en/solution-templates/single-layer-web-application/distributed-locking.md diff --git a/docs/en/solution-templates/single-layer-web-application/background-workers.md b/docs/en/solution-templates/single-layer-web-application/background-workers.md index 7075d85879..4153d7b9b5 100644 --- a/docs/en/solution-templates/single-layer-web-application/background-workers.md +++ b/docs/en/solution-templates/single-layer-web-application/background-workers.md @@ -8,8 +8,8 @@ "Path": "solution-templates/single-layer-web-application/background-jobs" }, "Next": { - "Name": "Multi-Tenancy", - "Path": "solution-templates/single-layer-web-application/multi-tenancy" + "Name": "Distributed Locking", + "Path": "solution-templates/single-layer-web-application/distributed-locking" } } ``` diff --git a/docs/en/solution-templates/single-layer-web-application/distributed-locking.md b/docs/en/solution-templates/single-layer-web-application/distributed-locking.md new file mode 100644 index 0000000000..09f032fe16 --- /dev/null +++ b/docs/en/solution-templates/single-layer-web-application/distributed-locking.md @@ -0,0 +1,44 @@ +# Single Layer Solution: Distributed Locking + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Background Workers", + "Path": "solution-templates/single-layer-web-application/background-workers" + }, + "Next": { + "Name": "Multi-Tenancy", + "Path": "solution-templates/single-layer-web-application/multi-tenancy" + } +} +``` + +Distributed locking is a mechanism that allows multiple instances of an application to coordinate and synchronize access to shared resources. It is useful for scenarios where multiple instances of an application need to ensure that only one instance can access a resource at a time. You can learn more in the [Distributed Locking](../../framework/infrastructure/distributed-locking.md) document. + +## Distributed Locking in Single Layer Solutions + +The single-layer solution templates does not include distributed lock package by default. You can add the [Volo.Abp.DistributedLock](https://www.nuget.org/packages/Volo.Abp.DistributedLocking) package to your project to use distributed locking. This package provides a distributed lock mechanism that works with Redis. You can inject the `IAbpDistributedLock` service to acquire and release. Here is an example of using distributed locking in your application: + +```csharp +public class MyService : ITransientDependency +{ + private readonly IAbpDistributedLock _distributedLock; + + public MyService(IAbpDistributedLock distributedLock) + { + _distributedLock = distributedLock; + } + + public async Task MyMethodAsync() + { + await using (var handle = await _distributedLock.TryAcquireAsync("MyLockName")) + { + if (handle != null) + { + // your code that access the shared resource + } + } + } +} +``` diff --git a/docs/en/solution-templates/single-layer-web-application/index.md b/docs/en/solution-templates/single-layer-web-application/index.md index be7908d87b..cccba5f1ea 100644 --- a/docs/en/solution-templates/single-layer-web-application/index.md +++ b/docs/en/solution-templates/single-layer-web-application/index.md @@ -30,6 +30,7 @@ ABP Studio offers pre-architected, production-ready templates to quickly start a * [Swagger integration](swagger-integration.md) * [Bacground Jobs](background-jobs.md) * [Background Workers](background-workers.md) + * [Distributed Locking](distributed-locking.md) * [Multi-Tenancy](multi-tenancy.md) * [BLOB storing](blob-storing.md) * [CORS configuration](cors-configuration.md) \ No newline at end of file diff --git a/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md b/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md index 8a9a9be41f..b2cd042d0e 100644 --- a/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md +++ b/docs/en/solution-templates/single-layer-web-application/multi-tenancy.md @@ -4,8 +4,8 @@ //[doc-nav] { "Previous": { - "Name": "Background Workers", - "Path": "solution-templates/single-layer-web-application/background-workers" + "Name": "Distributed Locking", + "Path": "solution-templates/single-layer-web-application/distributed-locking" }, "Next": { "Name": "BLOB storing", From 48697f49cba624bf06249350c69f5b068440dd79 Mon Sep 17 00:00:00 2001 From: ahmetfarukulu Date: Tue, 31 Dec 2024 16:01:36 +0300 Subject: [PATCH 7/8] docs: add distributed locking documentation and update navigation links --- .../background-workers.md | 4 +- .../distributed-locking.md | 44 +++++++++++++++++++ .../layered-web-application/index.md | 1 + .../layered-web-application/multi-tenancy.md | 4 +- .../distributed-locking.md | 2 +- 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 docs/en/solution-templates/layered-web-application/distributed-locking.md diff --git a/docs/en/solution-templates/layered-web-application/background-workers.md b/docs/en/solution-templates/layered-web-application/background-workers.md index 61f766abd5..6c0b3fdb11 100644 --- a/docs/en/solution-templates/layered-web-application/background-workers.md +++ b/docs/en/solution-templates/layered-web-application/background-workers.md @@ -8,8 +8,8 @@ "Path": "solution-templates/layered-web-application/background-jobs" }, "Next": { - "Name": "Multi-Tenancy", - "Path": "solution-templates/layered-web-application/multi-tenancy" + "Name": "Distribution Locking", + "Path": "solution-templates/layered-web-application/distributed-locking" } } ``` diff --git a/docs/en/solution-templates/layered-web-application/distributed-locking.md b/docs/en/solution-templates/layered-web-application/distributed-locking.md new file mode 100644 index 0000000000..652a9e4376 --- /dev/null +++ b/docs/en/solution-templates/layered-web-application/distributed-locking.md @@ -0,0 +1,44 @@ +# Layered Solution: Distributed Locking + +```json +//[doc-nav] +{ + "Previous": { + "Name": "Background Workers", + "Path": "solution-templates/layered-web-application/background-workers" + }, + "Next": { + "Name": "Multi-Tenancy", + "Path": "solution-templates/layered-web-application/multi-tenancy" + } +} +``` + +Distributed locking is a mechanism that enables multiple instances of an application to coordinate and synchronize access to shared resources. It is particularly useful in scenarios where multiple instances need to ensure that only one instance can access a resource at a time. For more information, refer to the [Distributed Locking](../../framework/infrastructure/distributed-locking.md) document. + +## Distributed Locking in Layered Solutions + +The layered solution template does not include the distributed lock package by default unless it's a *Tiered* or *Public Website* application. To use distributed locking, you can add the [Volo.Abp.DistributedLock](https://www.nuget.org/packages/Volo.Abp.DistributedLocking) package to your project. This package provides a distributed lock mechanism that works with Redis. You can inject the `IAbpDistributedLock` service to acquire and release locks. Below is an example of using distributed locking in your application: + +```csharp +public class MyService : ITransientDependency +{ + private readonly IAbpDistributedLock _distributedLock; + + public MyService(IAbpDistributedLock distributedLock) + { + _distributedLock = distributedLock; + } + + public async Task MyMethodAsync() + { + await using (var handle = await _distributedLock.TryAcquireAsync("MyLockName")) + { + if (handle != null) + { + // your code that access the shared resource + } + } + } +} +``` diff --git a/docs/en/solution-templates/layered-web-application/index.md b/docs/en/solution-templates/layered-web-application/index.md index 0c2e4fdef0..c370cff69c 100644 --- a/docs/en/solution-templates/layered-web-application/index.md +++ b/docs/en/solution-templates/layered-web-application/index.md @@ -31,6 +31,7 @@ ABP Studio provides pre-architected, production-ready templates to jump-start a * [Swagger integration](swagger-integration.md) * [Bacground Jobs](background-jobs.md) * [Background Workers](background-workers.md) + * [Distributed Locking](distributed-locking.md) * [Multi-Tenancy](multi-tenancy.md) * [BLOB storing](blob-storing.md) * [CORS configuration](cors-configuration.md) diff --git a/docs/en/solution-templates/layered-web-application/multi-tenancy.md b/docs/en/solution-templates/layered-web-application/multi-tenancy.md index 4011535d4d..632b392ebf 100644 --- a/docs/en/solution-templates/layered-web-application/multi-tenancy.md +++ b/docs/en/solution-templates/layered-web-application/multi-tenancy.md @@ -4,8 +4,8 @@ //[doc-nav] { "Previous": { - "Name": "Background Workers", - "Path": "solution-templates/layered-web-application/background-workers" + "Name": "Distribution Locking", + "Path": "solution-templates/layered-web-application/distributed-locking" }, "Next": { "Name": "BLOB storing", diff --git a/docs/en/solution-templates/single-layer-web-application/distributed-locking.md b/docs/en/solution-templates/single-layer-web-application/distributed-locking.md index 09f032fe16..f99adba265 100644 --- a/docs/en/solution-templates/single-layer-web-application/distributed-locking.md +++ b/docs/en/solution-templates/single-layer-web-application/distributed-locking.md @@ -18,7 +18,7 @@ Distributed locking is a mechanism that allows multiple instances of an applicat ## Distributed Locking in Single Layer Solutions -The single-layer solution templates does not include distributed lock package by default. You can add the [Volo.Abp.DistributedLock](https://www.nuget.org/packages/Volo.Abp.DistributedLocking) package to your project to use distributed locking. This package provides a distributed lock mechanism that works with Redis. You can inject the `IAbpDistributedLock` service to acquire and release. Here is an example of using distributed locking in your application: +The single-layer solution template does not include distributed lock package by default. You can add the [Volo.Abp.DistributedLock](https://www.nuget.org/packages/Volo.Abp.DistributedLocking) package to your project to use distributed locking. This package provides a distributed lock mechanism that works with Redis. You can inject the `IAbpDistributedLock` service to acquire and release. Here is an example of using distributed locking in your application: ```csharp public class MyService : ITransientDependency From 18a5ca31bf5597e80a33f7eb64a4d737e9bf6221 Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Tue, 31 Dec 2024 16:48:29 +0300 Subject: [PATCH 8/8] Revise solution template docs --- .../layered-web-application/background-workers.md | 2 +- docs/en/solution-templates/layered-web-application/index.md | 2 +- .../single-layer-web-application/background-workers.md | 2 +- .../en/solution-templates/single-layer-web-application/index.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/solution-templates/layered-web-application/background-workers.md b/docs/en/solution-templates/layered-web-application/background-workers.md index 6c0b3fdb11..500a21756b 100644 --- a/docs/en/solution-templates/layered-web-application/background-workers.md +++ b/docs/en/solution-templates/layered-web-application/background-workers.md @@ -48,7 +48,7 @@ public class PassiveUserCheckerWorker : AsyncPeriodicBackgroundWorkerBase } ``` -After creating a worker, we should also register it in the application. We might add it in the *Domain* or *Application* layer. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. +After creating a worker, you should also register it in the application. You might add it in the *Domain* or *Application* layer. You can register your worker in the `OnApplicationInitializationAsync` method of your module class: ```csharp public class BookstoreApplicationModule : AbpModule diff --git a/docs/en/solution-templates/layered-web-application/index.md b/docs/en/solution-templates/layered-web-application/index.md index c370cff69c..e1e5997154 100644 --- a/docs/en/solution-templates/layered-web-application/index.md +++ b/docs/en/solution-templates/layered-web-application/index.md @@ -29,7 +29,7 @@ ABP Studio provides pre-architected, production-ready templates to jump-start a * [Database configurations](database-configurations.md) * [Logging (with Serilog)](logging.md) * [Swagger integration](swagger-integration.md) - * [Bacground Jobs](background-jobs.md) + * [Background Jobs](background-jobs.md) * [Background Workers](background-workers.md) * [Distributed Locking](distributed-locking.md) * [Multi-Tenancy](multi-tenancy.md) diff --git a/docs/en/solution-templates/single-layer-web-application/background-workers.md b/docs/en/solution-templates/single-layer-web-application/background-workers.md index 4153d7b9b5..15cad61797 100644 --- a/docs/en/solution-templates/single-layer-web-application/background-workers.md +++ b/docs/en/solution-templates/single-layer-web-application/background-workers.md @@ -48,7 +48,7 @@ public class PassiveUserCheckerWorker : AsyncPeriodicBackgroundWorkerBase } ``` -After creating a worker, we should also register it in the application. You can register your worker in the `OnApplicationInitializationAsync` method of your module class. +After creating a worker, you should also register it in the application. You can register your worker in the `OnApplicationInitializationAsync` method of your module class: ```csharp public class BookstoreModule : AbpModule diff --git a/docs/en/solution-templates/single-layer-web-application/index.md b/docs/en/solution-templates/single-layer-web-application/index.md index cccba5f1ea..ce295f20a9 100644 --- a/docs/en/solution-templates/single-layer-web-application/index.md +++ b/docs/en/solution-templates/single-layer-web-application/index.md @@ -28,7 +28,7 @@ ABP Studio offers pre-architected, production-ready templates to quickly start a * [Database configurations](database-configurations.md) * [Logging (with Serilog)](logging.md) * [Swagger integration](swagger-integration.md) - * [Bacground Jobs](background-jobs.md) + * [Background Jobs](background-jobs.md) * [Background Workers](background-workers.md) * [Distributed Locking](distributed-locking.md) * [Multi-Tenancy](multi-tenancy.md)