Acquiring one permit from a rate limiter and using a cancelation token is a common scenario. This should be built in to the core
API Proposal
namespace System.Threading.RateLimiting;
public class RateLimiter
{
public ValueTask<RateLimitLease> AcquireAsync(CancellationToken cancellationToken);
}
API Usage
using var Lease = await RateLimiter.AcquireAsync(Token);
Background and motivation
Acquiring one permit from a rate limiter and using a cancelation token is a common scenario. This should be built in to the core
API Proposal
API Usage
Alternative Designs
This could be implemented as an extension method.
Risks
No response