Skip to content

System.Threading.RateLimiting consistent naming for permit count #76557

Closed
@AliKhalili

Description

@AliKhalili

In System.Threading.RateLimiting library, its authors consider permit count as the number of permits that client can request.

/// <summary>
/// Method that <see cref="RateLimiter"/> implementations implement for <see cref="AttemptAcquire"/>.
/// </summary>
/// <param name="permitCount">Number of permits to try and acquire.</param>
/// <returns></returns>
protected abstract RateLimitLease AttemptAcquireCore(int permitCount);

but the FixedWindowRateLimiter and SlidingWindowRateLimiter classes are using requestCount for naming permit count which is breaking the naming consistency and also loses the inherited comment for permitCount parameter.

/// <inheritdoc/>
protected override RateLimitLease AttemptAcquireCore(int requestCount)

I would suggest it is more clear and consistent if it uses permitCount instead of requestCount all over the implementation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions