Skip to content

Commit

Permalink
Fix SA1618 (#2078)
Browse files Browse the repository at this point in the history
- Fix SA1618 by documenting typeparams
- Consolidate typeparam text.
  • Loading branch information
iamdmitrij authored Apr 29, 2024
1 parent c97c364 commit 08d7bc4
Show file tree
Hide file tree
Showing 54 changed files with 334 additions and 51 deletions.
3 changes: 3 additions & 0 deletions src/Polly/AsyncPolicy.ExecuteOverloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public Task<TResult> ExecuteAsync<TResult>(Func<Task<TResult>> action) =>
/// <summary>
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <returns>The value returned by the action.</returns>
Expand Down Expand Up @@ -155,6 +156,7 @@ public Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>
/// <summary>
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
Expand Down Expand Up @@ -191,6 +193,7 @@ public Task<TResult> ExecuteAsync<TResult>(Func<CancellationToken, Task<TResult>
/// <summary>
/// Executes the specified asynchronous action within the policy and returns the result.
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="action">The action to perform.</param>
/// <param name="contextData">Arbitrary data that is passed to the exception policy.</param>
/// <param name="cancellationToken">A cancellation token which can be used to cancel the action. When a retry policy in use, also cancels any further retries.</param>
Expand Down
4 changes: 4 additions & 0 deletions src/Polly/Bulkhead/AsyncBulkheadTResultSyntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public partial class Policy
/// <para>Builds a bulkhead isolation <see cref="AsyncPolicy{TResult}"/>, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.</para>
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization"/>, the action is not executed and a <see cref="BulkheadRejectedException"/> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <returns>The policy instance.</returns>
public static AsyncBulkheadPolicy<TResult> BulkheadAsync<TResult>(int maxParallelization)
Expand All @@ -19,6 +20,7 @@ public static AsyncBulkheadPolicy<TResult> BulkheadAsync<TResult>(int maxParalle
/// <para>Builds a bulkhead isolation <see cref="AsyncPolicy{TResult}"/>, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.</para>
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization"/>, the action is not executed and a <see cref="BulkheadRejectedException"/> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="onBulkheadRejectedAsync">An action to call asynchronously, if the bulkhead rejects execution due to oversubscription.</param>
/// <exception cref="ArgumentOutOfRangeException">maxParallelization;Value must be greater than zero.</exception>
Expand All @@ -31,6 +33,7 @@ public static AsyncBulkheadPolicy<TResult> BulkheadAsync<TResult>(int maxParalle
/// Builds a bulkhead isolation <see cref="AsyncPolicy{TResult}" />, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization" />, the policy allows a further <paramref name="maxQueuingActions" /> executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed <paramref name="maxQueuingActions" />, a <see cref="BulkheadRejectedException" /> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="maxQueuingActions">The maximum number of actions that may be queuing, waiting for an execution slot.</param>
/// <returns>The policy instance.</returns>
Expand All @@ -46,6 +49,7 @@ public static AsyncBulkheadPolicy<TResult> BulkheadAsync<TResult>(int maxParalle
/// Builds a bulkhead isolation <see cref="AsyncPolicy{TResult}" />, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization" />, the policy allows a further <paramref name="maxQueuingActions" /> executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed <paramref name="maxQueuingActions" />, a <see cref="BulkheadRejectedException" /> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="maxQueuingActions">The maximum number of actions that may be queuing, waiting for an execution slot.</param>
/// <param name="onBulkheadRejectedAsync">An action to call asynchronously, if the bulkhead rejects execution due to oversubscription.</param>
Expand Down
1 change: 1 addition & 0 deletions src/Polly/Bulkhead/BulkheadPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void Dispose()
/// <summary>
/// A bulkhead-isolation policy which can be applied to delegates returning a value of type <typeparamref name="TResult"/>.
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
public class BulkheadPolicy<TResult> : Policy<TResult>, IBulkheadPolicy<TResult>
{
private readonly SemaphoreSlim _maxParallelizationSemaphore;
Expand Down
4 changes: 4 additions & 0 deletions src/Polly/Bulkhead/BulkheadTResultSyntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public partial class Policy
/// <para>Builds a bulkhead isolation <see cref="Policy{TResult}"/>, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.</para>
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization"/>, the action is not executed and a <see cref="BulkheadRejectedException"/> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <exception cref="ArgumentOutOfRangeException">maxParallelization;Value must be greater than zero.</exception>
/// <returns>The policy instance.</returns>
Expand All @@ -20,6 +21,7 @@ public static BulkheadPolicy<TResult> Bulkhead<TResult>(int maxParallelization)
/// <para>Builds a bulkhead isolation <see cref="Policy{TResult}"/>, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.</para>
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization"/>, the action is not executed and a <see cref="BulkheadRejectedException"/> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="onBulkheadRejected">An action to call, if the bulkhead rejects execution due to oversubscription.</param>
/// <exception cref="ArgumentOutOfRangeException">maxParallelization;Value must be greater than zero.</exception>
Expand All @@ -32,6 +34,7 @@ public static BulkheadPolicy<TResult> Bulkhead<TResult>(int maxParallelization,
/// Builds a bulkhead isolation <see cref="Policy{TResult}" />, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization" />, the policy allows a further <paramref name="maxQueuingActions" /> executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed <paramref name="maxQueuingActions" />, a <see cref="BulkheadRejectedException" /> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="maxQueuingActions">The maximum number of actions that may be queuing, waiting for an execution slot.</param>
/// <returns>The policy instance.</returns>
Expand All @@ -47,6 +50,7 @@ public static BulkheadPolicy<TResult> Bulkhead<TResult>(int maxParallelization,
/// Builds a bulkhead isolation <see cref="Policy{TResult}" />, which limits the maximum concurrency of actions executed through the policy. Imposing a maximum concurrency limits the potential of governed actions, when faulting, to bring down the system.
/// <para>When an execution would cause the number of actions executing concurrently through the policy to exceed <paramref name="maxParallelization" />, the policy allows a further <paramref name="maxQueuingActions" /> executions to queue, waiting for a concurrent execution slot. When an execution would cause the number of queuing actions to exceed <paramref name="maxQueuingActions" />, a <see cref="BulkheadRejectedException" /> is thrown.</para>
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
/// <param name="maxParallelization">The maximum number of concurrent actions that may be executing through the policy.</param>
/// <param name="maxQueuingActions">The maximum number of actions that may be queuing, waiting for an execution slot.</param>
/// <param name="onBulkheadRejected">An action to call, if the bulkhead rejects execution due to oversubscription.</param>
Expand Down
1 change: 1 addition & 0 deletions src/Polly/Bulkhead/IBulkheadPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public interface IBulkheadPolicy : IsPolicy, IDisposable
/// <summary>
/// Defines properties and methods common to all bulkhead policies generic-typed for executions returning results of type <typeparamref name="TResult"/>.
/// </summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
public interface IBulkheadPolicy<TResult> : IBulkheadPolicy
{
}
Loading

0 comments on commit 08d7bc4

Please sign in to comment.