using System;
namespace Esiur.Resource;
///
/// Runtime configuration owned by a Warehouse instance.
///
public sealed class WarehouseConfiguration
{
public RateControlConfiguration RateControl { get; set; } = new RateControlConfiguration();
}
///
/// Configures how repeated rate-control denials affect an EP connection.
///
public sealed class RateControlConfiguration
{
///
/// Number of denials within that blocks the connection.
/// Set to zero to disable connection blocking.
///
public int DenialsBeforeConnectionBlock { get; set; } = 5;
///
/// Window in which denials are accumulated for connection blocking.
///
public TimeSpan DenialWindow { get; set; } = TimeSpan.FromMinutes(1);
///
/// Delay before a blocked connection is closed, allowing its final error reply to flush.
///
public TimeSpan ConnectionBlockDelay { get; set; } = TimeSpan.FromMilliseconds(100);
}