Table of Contents

Interface IRateLimiter

Namespace
JD.AI.Core.Security
Assembly
JD.AI.Core.dll

Rate limiter for gateway operations.

public interface IRateLimiter

Methods

AllowAsync(string, CancellationToken)

Returns true if the request is allowed; false if rate-limited.

Task<bool> AllowAsync(string key, CancellationToken ct = default)

Parameters

key string
ct CancellationToken

Returns

Task<bool>

CheckAsync(string, CancellationToken)

Checks the rate limit and returns detailed result with remaining quota and reset time.

Task<RateLimitResult> CheckAsync(string key, CancellationToken ct = default)

Parameters

key string
ct CancellationToken

Returns

Task<RateLimitResult>