namespace ZB.MOM.WW.MxGateway.Contracts;
/// Names of environment variables shared by the gateway worker launcher and worker process.
public static class WorkerLaunchEnvironment
{
/// Bootstrap nonce used to authenticate the worker handshake.
public const string WorkerNonce = "MXGATEWAY_WORKER_NONCE";
/// Per-attempt named-pipe connection timeout in milliseconds.
public const string PipeConnectAttemptTimeoutMilliseconds =
"MXGATEWAY_WORKER_PIPE_CONNECT_ATTEMPT_TIMEOUT_MS";
/// Bounded wait for a Write/Write2/WriteSecured/WriteSecured2 completion callback in milliseconds.
public const string WriteCompletionWaitMilliseconds =
"MXGATEWAY_WORKER_WRITE_COMPLETION_WAIT_MS";
/// Capacity of the worker's outbound MXAccess event queue.
public const string EventQueueCapacity = "MXGATEWAY_EVENT_QUEUE_CAPACITY";
/// Worker alarm polling cadence in milliseconds.
public const string AlarmPollIntervalMilliseconds = "MXGATEWAY_ALARM_POLL_INTERVAL_MS";
/// Maximum alarm records requested in one current-alarm fetch.
public const string MaxAlarmsPerFetch = "MXGATEWAY_ALARM_MAX_ALARMS_PER_FETCH";
///
/// MXAccess client name the worker's alarm-ack writer registers with. The
/// Historian records it as the acknowledgement's OperatorNode.
///
public const string AlarmAckClientName = "MXGATEWAY_ALARM_ACK_CLIENT_NAME";
///
/// Interval, in milliseconds, at which the worker sends heartbeats to the gateway. Set
/// from MxGateway:Worker:WorkerHeartbeatSendIntervalSeconds; the gateway's
/// HeartbeatGraceSeconds must exceed it or healthy workers are declared dead.
///
public const string HeartbeatSendIntervalMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_SEND_INTERVAL_MS";
///
/// Ceiling, in milliseconds, after which the worker's own STA watchdog faults
/// StaHung even while a command is in flight. Set from
/// MxGateway:Worker:WorkerHeartbeatStuckCeilingSeconds.
///
public const string HeartbeatStuckCeilingMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_STUCK_CEILING_MS";
///
/// Grace, in milliseconds, the worker's own STA watchdog allows STA activity to go stale
/// before faulting StaHung (when no command is in flight). Set from
/// MxGateway:Worker:WorkerHeartbeatGraceSeconds; the worker's stuck ceiling must
/// exceed it.
///
public const string HeartbeatGraceMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_GRACE_MS";
///
/// Deadline, in milliseconds, for the worker's startup handshake (the GatewayHello read
/// and MXAccess initialization). Set from MxGateway:Worker:StartupTimeoutSeconds, the
/// same bound the gateway applies to the whole launch, so a live gateway always gives up
/// (and kills the worker) first; the worker's own deadline only matters when the gateway is
/// gone.
///
public const string StartupTimeoutMilliseconds = "MXGATEWAY_WORKER_STARTUP_TIMEOUT_MS";
}