Lean  $LEAN_TAG$
QuantConnect.Util.RateLimit.FixedIntervalRefillStrategy Class Reference

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...

Inheritance diagram for QuantConnect.Util.RateLimit.FixedIntervalRefillStrategy:
[legend]

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FixedIntervalRefillStrategy()

QuantConnect.Util.RateLimit.FixedIntervalRefillStrategy.FixedIntervalRefillStrategy ( ITimeProvider  timeProvider,
long  refillAmount,
TimeSpan  refillInterval 
)

Initializes a new instance of the FixedIntervalRefillStrategy class.

Parameters
timeProviderProvides the current time used for determining how much time has elapsed between invocations of the refill method
refillAmountDefines the constant number of tokens to be made available for consumption each time the provided refillInterval has passed
refillIntervalThe amount of time that must pass before adding the specified refillAmount back to the bucket

Definition at line 44 of file FixedIntervalRefillStrategy.cs.

Here is the call graph for this function:

Member Function Documentation

◆ Refill()

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.


The documentation for this class was generated from the following file: