diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/ref/Microsoft.Extensions.Hosting.Abstractions.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/ref/Microsoft.Extensions.Hosting.Abstractions.cs index dc256ff6466f30..31e49199115acb 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/ref/Microsoft.Extensions.Hosting.Abstractions.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/ref/Microsoft.Extensions.Hosting.Abstractions.cs @@ -19,7 +19,7 @@ public abstract partial class BackgroundService : Microsoft.Extensions.Hosting.I protected BackgroundService() { } public virtual System.Threading.Tasks.Task? ExecuteTask { get { throw null; } } public virtual void Dispose() { } - protected abstract System.Threading.Tasks.Task ExecuteAsync(System.Threading.CancellationToken stoppingToken); + protected abstract System.Threading.Tasks.Task ExecuteAsync(System.Threading.CancellationToken cancellationToken); public virtual System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken) { throw null; } public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; } } diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs index a5c45d12a27b6a..2deebd327c86bc 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs @@ -27,10 +27,10 @@ public abstract class BackgroundService : IHostedService, IDisposable /// This method is called when the starts. The implementation should return a task that represents /// the lifetime of the long running operation(s) being performed. /// - /// Triggered when is called. + /// Triggered when is called. /// A that represents the long running operations. /// See Worker Services in .NET for implementation guidelines. - protected abstract Task ExecuteAsync(CancellationToken stoppingToken); + protected abstract Task ExecuteAsync(CancellationToken cancellationToken); /// /// Triggered when the application host is ready to start the service. diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/PACKAGE.md b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/PACKAGE.md index 400958a0a194a4..ce5406baf53c40 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/PACKAGE.md +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/PACKAGE.md @@ -83,12 +83,12 @@ public sealed class Worker : BackgroundService public Worker(ILogger logger) => _logger = logger; - protected override async Task ExecuteAsync(CancellationToken stoppingToken) + protected override async Task ExecuteAsync(CancellationToken cancellationToken) { - while (!stoppingToken.IsCancellationRequested) + while (!cancellationToken.IsCancellationRequested) { _logger.LogInformation("Worker running at: {time}", DateTimeOffset.UtcNow); - await Task.Delay(1_000, stoppingToken); + await Task.Delay(1_000, cancellationToken); } } } @@ -161,4 +161,4 @@ The main types provided by this library are: -Microsoft.Extensions.Logging.Abstractions is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime). \ No newline at end of file +Microsoft.Extensions.Logging.Abstractions is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).