Skip to content

Commit df44c05

Browse files
GramGibsonmairaw
authored andcommitted
Update background-tasks-with-ihostedservice.md (#5807)
Spelling corrections.
1 parent 4ef5342 commit df44c05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/standard/microservices-architecture/multi-container-microservice-net-applications/background-tasks-with-ihostedservice.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A `WebHost` (base class implementing `IWebHost`) in ASP.NET Core 2.0 is the infr
2222

2323
A `Host` (base class implementing `IHost`), however, is something new in .NET Core 2.1. Basically, a `Host` allows you to have a similar infrastructure than what you have with `WebHost` (dependency injection, hosted services, etc.), but in this case, you just want to have a simple and lighter process as the host, with nothing related to MVC, Web API or HTTP server features.
2424

25-
Therefore, you can choose and either create a specialized host-process with IHost to handle the hosted services and nothing else, such a microservice made just for hosting the `IHostedServices`, or you can alternatevely extend an existing ASP.NET Core `WebHost`, such as an existing ASP.NET Core Web API or MVC app.
25+
Therefore, you can choose and either create a specialized host-process with IHost to handle the hosted services and nothing else, such a microservice made just for hosting the `IHostedServices`, or you can alternatively extend an existing ASP.NET Core `WebHost`, such as an existing ASP.NET Core Web API or MVC app.
2626

2727
Each approach has pros and cons depending on your business and scalability needs. The bottom line is basically that if your background tasks have nothing to do with HTTP (IWebHost) you should use and IHost, when available in .NET Core 2.1.
2828

@@ -95,7 +95,7 @@ As a developer, you are responsible for handling the stopping action or your ser
9595

9696
You could go ahead and create you custom hosted service class from scratch and implement the `IHostedService`, as you need to do when using .NET Core 2.0.
9797

98-
However, since most background tasks will have similar needs in regard to the cancellation tokens management and other tipical operations, .NET Core 2.1 will be providing a very convenient abstract base class you can derive from, named BackgroundService.
98+
However, since most background tasks will have similar needs in regard to the cancellation tokens management and other typical operations, .NET Core 2.1 will be providing a very convenient abstract base class you can derive from, named BackgroundService.
9999

100100
That class provides the main work needed to set up the background task. Note that this class will come in the .NET Core 2.1 library so you don’t need to write it.
101101

@@ -189,7 +189,7 @@ public class GracePeriodManagerService : BackgroundService
189189
{
190190
_logger.LogDebug($"GracePeriod task doing background work.");
191191

192-
// This eShopOnContainers method is quering a database table
192+
// This eShopOnContainers method is querying a database table
193193
// and publishing events into the Event Bus (RabbitMS / ServiceBus)
194194
CheckConfirmedGracePeriodOrders();
195195

@@ -207,7 +207,7 @@ public class GracePeriodManagerService : BackgroundService
207207
}
208208
```
209209

210-
In this specific case for eShopOnContainers, it is executing an application method which is quering a database table looking for orders with a specific state and when applying changes, it is publishing integration events through the event bus (underneath it can be using RabbitMQ or Azure Service Bus).
210+
In this specific case for eShopOnContainers, it is executing an application method which is querying a database table looking for orders with a specific state and when applying changes, it is publishing integration events through the event bus (underneath it can be using RabbitMQ or Azure Service Bus).
211211

212212
Of course, you could run any other business background task, instead.
213213

0 commit comments

Comments
 (0)