December 2019
Intermediate to advanced
510 pages
11h 33m
English
.NET Core uses the definition of the BackgroundService class to identify a worker service. The BackgroundService class exposes three methods that represent the life cycle stages of the worker service:
namespace Microsoft.Extensions.Hosting{ public abstract class BackgroundService : IHostedService, IDisposable { public virtual Task StartAsync(CancellationToken cancellationToken); protected abstract Task ExecuteAsync(CancellationToken stoppingToken); public virtual async Task StopAsync(CancellationToken cancellationToken); }}
The preceding code is the abstract implementation of the BackgroundService class. The class implements both the IHostedService and IDisposable interfaces, and it exposes ...
Read now
Unlock full access