Serenity.Throttler.Throttler C# (CSharp) Method

Throttler() public method

Creates a new throttler
public Throttler ( string key, System.TimeSpan duration, int limit ) : System
key string Cache key for throttler. Include the resource name, e.g. username, you are throttling
duration System.TimeSpan Check period
limit int How many times are allowed
return System
        public Throttler(string key, TimeSpan duration, int limit)
        {
            Key = key;
            Duration = duration;
            Limit = limit;
            CacheKey = "Throttling:" + key + ":" + duration.Ticks.ToInvariant();
        }