Lean
$LEAN_TAG$
|
Provides a refill strategy that has a constant, quantized refill rate. For example, after 1 minute passes add 5 units. If 59 seconds has passed, it will add zero unit, but if 2 minutes have passed, then 10 units would be added. More...
Public Member Functions | |
FixedIntervalRefillStrategy (ITimeProvider timeProvider, long refillAmount, TimeSpan refillInterval) | |
Initializes a new instance of the FixedIntervalRefillStrategy class. More... | |
long | Refill () |
Computes the number of new tokens made available to the bucket for consumption by determining the number of time intervals that have passed and multiplying by the number of tokens to refill for each time interval. More... | |
Provides a refill strategy that has a constant, quantized refill rate. For example, after 1 minute passes add 5 units. If 59 seconds has passed, it will add zero unit, but if 2 minutes have passed, then 10 units would be added.
Definition at line 25 of file FixedIntervalRefillStrategy.cs.
QuantConnect.Util.RateLimit.FixedIntervalRefillStrategy.FixedIntervalRefillStrategy | ( | ITimeProvider | timeProvider, |
long | refillAmount, | ||
TimeSpan | refillInterval | ||
) |
Initializes a new instance of the FixedIntervalRefillStrategy class.
timeProvider | Provides the current time used for determining how much time has elapsed between invocations of the refill method |
refillAmount | Defines the constant number of tokens to be made available for consumption each time the provided refillInterval has passed |
refillInterval | The amount of time that must pass before adding the specified refillAmount back to the bucket |
Definition at line 44 of file FixedIntervalRefillStrategy.cs.
long QuantConnect.Util.RateLimit.FixedIntervalRefillStrategy.Refill | ( | ) |
Computes the number of new tokens made available to the bucket for consumption by determining the number of time intervals that have passed and multiplying by the number of tokens to refill for each time interval.
Implements QuantConnect.Util.RateLimit.IRefillStrategy.
Definition at line 57 of file FixedIntervalRefillStrategy.cs.