namespace NpgsqlRest;
///
/// Per-endpoint dedupe state for the unbound-RAISE warning. The warning fires once per endpoint per
/// process lifetime — after that the endpoint is in and the runtime takes the
/// fast path. exists for tests that need to re-run the warning logic against
/// the same endpoint paths.
///
internal static class SseUnboundWarner
{
private static readonly HashSet _warned = new(StringComparer.Ordinal);
private static readonly object _lock = new();
public static bool TryMarkWarned(string endpointPath)
{
lock (_lock)
{
return _warned.Add(endpointPath);
}
}
internal static void Reset()
{
lock (_lock)
{
_warned.Clear();
}
}
}