Throttler class
namespace: Serenity assembly: Serenity.Net.Core
Limits the rate of an operation, for example allowing only 10 login attempts per minute.
public class Throttler
Public Members
| name | description |
|---|---|
| Throttler(…) | Initializes a new throttler backed by an in-memory cache. (2 constructors) |
| CacheKey { get; } | Gets the full cache key used to store the throttling state. |
| Duration { get; } | Gets the sliding window duration. |
| Key { get; } | Gets the logical key identifying the throttled resource. |
| Limit { get; } | Gets the maximum number of attempts allowed within Duration. |
| Check() | Records an attempt and checks whether the throttling limit has been exceeded. |
| Reset() | Clears the throttling state for the current key. |
See Also
- Source: Throttler.cs