using CryptoExchange.Net.Objects; using Microsoft.Extensions.Logging; using System.Net.Http; using System.Security; using System.Threading; using System.Threading.Tasks; namespace CryptoExchange.Net.Interfaces { /// /// Rate limiter interface /// public interface IRateLimiter { /// /// Limit a request based on previous requests made /// /// The logger /// The endpoint the request is for /// The Http request method /// Whether the request is singed(private) or not /// The api key making this request /// The limit behavior for when the limit is reached /// The weight of the request /// Cancellation token to cancel waiting /// The time in milliseconds spend waiting Task> LimitRequestAsync(ILogger log, string endpoint, HttpMethod method, bool signed, SecureString? apiKey, RateLimitingBehaviour limitBehaviour, int requestWeight, CancellationToken ct); } }