namespace ZB.MOM.WW.MxGateway.Contracts;
///
/// Machine-readable reason codes the gateway attaches to gRPC ResourceExhausted failures
/// via the response trailer, so a client can tell "you fell behind and
/// events were lost" from "a limit was reached". The gRPC status code itself is unchanged.
///
public static class ResourceExhaustedReasons
{
/// Response-trailer key carrying the reason code (gRPC trailer keys are lower-case ASCII).
public const string TrailerKey = "mxgw-reason";
/// The subscriber fell behind its bounded event queue and was disconnected; events were lost. Re-subscribe and resync.
public const string EventQueueOverflow = "event-queue-overflow";
/// The alarm-feed subscriber fell behind its bounded queue and was dropped. Reconnect and re-snapshot.
public const string AlarmFeedOverflow = "alarm-feed-overflow";
/// The per-session event-subscriber cap was reached. Back off; do not retry immediately.
public const string SubscriberLimit = "subscriber-limit";
/// The session already has an active event subscriber and only one is allowed.
public const string SubscriberAlreadyActive = "subscriber-already-active";
/// The gateway session limit was reached.
public const string SessionLimit = "session-limit";
/// A command exceeded the maximum frame size.
public const string CommandTooLarge = "command-too-large";
}