1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-13 01:12:59 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/RateLimiting/Interfaces/IWindowTracker.cs
T
2024-04-16 14:55:27 +02:00

35 lines
955 B
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>
/// <param name="weight"></param>
/// <returns></returns>
TimeSpan GetWaitTime(int weight);
/// <summary>
/// Register the weight in this window
/// </summary>
/// <param name="weight">Request weight</param>
void ApplyWeight(int weight);
}
}