Standardizes cancellation token parameter documentation

This commit is contained in:
BinaryAlley committed 2026-10-17 20:51:47 +03:00
1 parent e6fa85f7c6
commit 6991640710
15 files changed
+16 -16

No files matched your search

@@ -17,7 +17,7 @@ public interface ICommandHandler<in TCommand, TResult> where TCommand : ICommand
/// Handles the specified command and returns a result.
/// </summary>
/// <param name="command">The command to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the command execution.</returns>
Task<TResult> HandleAsync(TCommand command, CancellationToken cancellationToken = default);
}
@@ -17,7 +17,7 @@ public interface IQueryHandler<in TQuery, TResult> where TQuery : IQuery
/// Handles the specified query and returns a result.
/// </summary>
/// <param name="query">The query to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the query execution.</returns>
Task<TResult> HandleAsync(TQuery query, CancellationToken cancellationToken = default);
}
@@ -36,7 +36,7 @@ public class TelemetryCommandHandlerDecorator<TCommand, TResult> : ICommandHandl
/// Handles the specified command, emitting telemetry around the execution of the wrapped handler.
/// </summary>
/// <param name="command">The command to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the command execution.</returns>
public async Task<TResult> HandleAsync(TCommand command, CancellationToken cancellationToken)
{
@@ -35,7 +35,7 @@ public class TelemetryDomainEventHandlerDecorator<TDomainEvent> : IDomainEventHa
/// Handles the specified domain event, emitting telemetry around the execution of the wrapped handler.
/// </summary>
/// <param name="domainEvent">The domain event to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
public async ValueTask HandleAsync(TDomainEvent domainEvent, CancellationToken cancellationToken)
{
@@ -36,7 +36,7 @@ public class TelemetryQueryHandlerDecorator<TQuery, TResult> : IQueryHandler<TQu
/// Handles the specified query, emitting telemetry around the execution of the wrapped handler.
/// </summary>
/// <param name="query">The query to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the query execution.</returns>
public async Task<TResult> HandleAsync(TQuery query, CancellationToken cancellationToken)
{
@@ -15,7 +15,7 @@ public interface IDomainEventHandler<TDomainEvent> where TDomainEvent : IDomainE
/// Handles the specified <paramref name="domainEvent"/>.
/// </summary>
/// <param name="domainEvent">The domain event to handle.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
ValueTask HandleAsync(TDomainEvent domainEvent, CancellationToken cancellationToken);
}
@@ -14,7 +14,7 @@ public interface IDomainEventPublisher
/// Publishes the specified <paramref name="domainEvent"/> to all its registered handlers, in registration order.
/// </summary>
/// <param name="domainEvent">The domain event to publish.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
ValueTask PublishAsync(IDomainEvent domainEvent, CancellationToken cancellationToken = default);
}
@@ -32,7 +32,7 @@ public class DomainEventPublisher : IDomainEventPublisher
/// Publishes the specified <paramref name="domainEvent"/> to all its registered handlers, in registration order.
/// </summary>
/// <param name="domainEvent">The domain event to publish.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
public ValueTask PublishAsync(IDomainEvent domainEvent, CancellationToken cancellationToken = default)
{
@@ -54,7 +54,7 @@ public class DomainEventPublisher : IDomainEventPublisher
/// <typeparam name="TDomainEvent">The type of the domain event being dispatched.</typeparam>
/// <param name="domainEvent">The domain event to dispatch.</param>
/// <param name="serviceProvider">The provider used to resolve the domain event handlers.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
private static async Task DispatchAsync<TDomainEvent>(IDomainEvent domainEvent, IServiceProvider serviceProvider, CancellationToken cancellationToken)
where TDomainEvent : IDomainEvent
@@ -37,7 +37,7 @@ internal sealed class PluginSettingsStore : IPluginSettingsStore
/// Gets the settings persisted by the host for the plugin identified by <paramref name="pluginId"/>.
/// </summary>
/// <param name="pluginId">The unique identifier of the plugin whose settings are read.</param>
/// <param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The persisted settings keyed by setting key, or <see langword="null"/> when no settings were persisted for the plugin.</returns>
public async Task<IReadOnlyDictionary<string, string>?> GetSettingsAsync(Guid pluginId, CancellationToken cancellationToken)
{
@@ -26,7 +26,7 @@ internal interface IScheduledJobCycleTicker : IDisposable
/// <summary>
/// Waits until the next tick of the ticker, or until the ticker is disposed or <paramref name="cancellationToken"/> is cancelled.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the wait.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns><see langword="true"/> when a tick occurred; <see langword="false"/> when the ticker was disposed before the next tick.</returns>
ValueTask<bool> WaitForNextTickAsync(CancellationToken cancellationToken);
}
@@ -36,7 +36,7 @@ internal sealed class PeriodicScheduledJobCycleTicker : IScheduledJobCycleTicker
/// <summary>
/// Waits until the next tick of the ticker, or until the ticker is disposed or <paramref name="cancellationToken"/> is cancelled.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the wait.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns><see langword="true"/> when a tick occurred; <see langword="false"/> when the ticker was disposed before the next tick.</returns>
public ValueTask<bool> WaitForNextTickAsync(CancellationToken cancellationToken)
{
@@ -16,7 +16,7 @@ public interface IPluginSettingsStore
/// Gets the settings persisted by the host for the plugin identified by <paramref name="pluginId"/>.
/// </summary>
/// <param name="pluginId">The unique identifier of the plugin whose settings are read.</param>
/// <param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The persisted settings keyed by setting key, or <see langword="null"/> when no settings were persisted for the plugin.</returns>
Task<IReadOnlyDictionary<string, string>?> GetSettingsAsync(Guid pluginId, CancellationToken cancellationToken);
}
@@ -29,7 +29,7 @@ public class DatabaseHealthCheck : IHealthCheck
/// Checks whether the database can be reached.
/// </summary>
/// <param name="context">The health check context.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the health check result.</returns>
public virtual async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
{
@@ -33,7 +33,7 @@ public class ApiReachabilityHealthCheck : IHealthCheck
/// Checks whether the remote API is reachable by probing its readiness endpoint.
/// </summary>
/// <param name="context">The health check context.</param>
/// <param name="cancellationToken">Token to monitor for cancellation requests.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A task that represents the asynchronous operation, containing the health check result.</returns>
public virtual async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken)
{
@@ -43,7 +43,7 @@ internal sealed class StubHttpMessageHandler : HttpMessageHandler
/// Returns a response with the configured status code and body.
/// </summary>
/// <param name="request">The request, which is ignored.</param>
/// <param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>The configured response.</returns>
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{