1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-11-03 16:57:44 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/RateLimiting/Interfaces/IWindowTracker.cs
T
Jan Korf ae7504c26c Shared API's V2 (#289)
Added V2 Shared API's infrastructure
Added request coalescing
Added rate limiting admission logic
Fixed some rate limiting issues
2026-09-23 09:15:39 +02:00

37 lines
1.0 KiB
C#

using System;
namespace CryptoExchange.Net.RateLimiting.Interfaces
{
/// <summary>
/// Rate limit window tracker
/// </summary>
public interface IWindowTracker
{
/// <summary>
/// Time period the limit is for
/// </summary>
TimeSpan TimePeriod { get; }
/// <summary>
/// The limit in the time period
/// </summary>
int Limit { get; }
/// <summary>
/// The current count within the time period
/// </summary>
int Current { get; }
/// <summary>
/// Get the time to wait to fit the weight
/// </summary>
TimeSpan GetWaitTime(int weight, double allowedRateRatio);
/// <summary>
/// Register the weight in this window
/// </summary>
/// <param name="weight">Request weight</param>
void ApplyWeight(int weight);
/// <summary>
/// Reset the limit counter for this tracker
/// </summary>
void Reset(int? amount);
}
}