C# Класс BB.Caching.Redis.RateLimiter

Used to limit the rate at which actions can be performed. This class uses redis to track the current usage and the throttling limit for a particular action.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Increment ( string key, System.TimeSpan spanSize, System.TimeSpan bucketSize, long throttle, int increment = 1 ) : StackExchange.Redis.RedisResult

Increments the rate limiter at the key specified by unless the increment goes over the , in which case it returns the amount it's gone over as a negative value.

IncrementAsync ( string key, System.TimeSpan spanSize, System.TimeSpan bucketSize, long throttle, int increment = 1 ) : Task

Increments the rate limiter at the key specified by unless the increment goes over the , in which case it returns the amount it's gone over as a negative value.

ScriptLoad ( ) : void

Loads the underlying Lua script(s) onto all necessary servers.

Описание методов

Increment() публичный статический Метод

Increments the rate limiter at the key specified by unless the increment goes over the , in which case it returns the amount it's gone over as a negative value.
public static Increment ( string key, System.TimeSpan spanSize, System.TimeSpan bucketSize, long throttle, int increment = 1 ) : StackExchange.Redis.RedisResult
key string The key where the rate limiter exists.
spanSize System.TimeSpan The full span of time being rate limited.
bucketSize System.TimeSpan The period of time that each bucket should track.
throttle long The total throttling size.
increment int How much to increment by.
Результат StackExchange.Redis.RedisResult

IncrementAsync() публичный статический Метод

Increments the rate limiter at the key specified by unless the increment goes over the , in which case it returns the amount it's gone over as a negative value.
public static IncrementAsync ( string key, System.TimeSpan spanSize, System.TimeSpan bucketSize, long throttle, int increment = 1 ) : Task
key string The key where the rate limiter exists.
spanSize System.TimeSpan The full span of time being rate limited.
bucketSize System.TimeSpan The period of time that each bucket should track.
throttle long The total throttling size.
increment int How much to increment by.
Результат Task

ScriptLoad() публичный статический Метод

Loads the underlying Lua script(s) onto all necessary servers.
public static ScriptLoad ( ) : void
Результат void