Méthode | Description | |
---|---|---|
RateLimiter ( double tokensPerSecond = 10, int maxTokensQueue = 10 ) : System |
Creates a RateLimiter
|
|
TryTakeToken ( ) : bool |
Attempts to take a token from the rate limiter.
|
|
UpdateLimits ( double tokensPerSecond, int maxTokensQueue ) : void |
Updates the limits associated with this rate limiter. Note, after this update, the tokens will be completely resupplied.
|
public RateLimiter ( double tokensPerSecond = 10, int maxTokensQueue = 10 ) : System | ||
tokensPerSecond | double | The number of tokens per second that can be generated. Must be greater than zero and less than 1 billion |
maxTokensQueue | int | The maximum number of tokens in the queue. Must be at least 1 |
Résultat | System |
public UpdateLimits ( double tokensPerSecond, int maxTokensQueue ) : void | ||
tokensPerSecond | double | The number of tokens per second that can be generated. Must be greater than zero and less than 1 billion |
maxTokensQueue | int | The maximum number of tokens in the queue. Must be at least 1 |
Résultat | void |