namespace ZB.MOM.WW.ScadaBridge.SiteRuntime; /// /// Configuration options for the Site Runtime component. /// Bound from ScadaBridge:SiteRuntime configuration section. /// public class SiteRuntimeOptions { /// /// Number of Instance Actors to create per batch during staggered startup. /// Default: 20. /// public int StartupBatchSize { get; set; } = 20; /// /// Delay in milliseconds between startup batches to prevent reconnection storms. /// Default: 100ms. /// public int StartupBatchDelayMs { get; set; } = 100; /// /// Maximum call depth for recursive script calls (CallScript/CallShared). /// Default: 10. /// public int MaxScriptCallDepth { get; set; } = 10; /// /// Default script execution timeout in seconds. /// Default: 30 seconds. /// public int ScriptExecutionTimeoutSeconds { get; set; } = 30; /// /// Per-subscriber buffer size for the site-wide Akka stream. /// Slow subscribers drop oldest messages when buffer is full. /// Default: 1000. /// public int StreamBufferSize { get; set; } = 1000; /// /// Number of dedicated threads in the script-execution scheduler. /// Script and alarm on-trigger bodies run on these threads instead of the shared /// .NET thread pool, so blocking script I/O cannot starve the global pool. /// Default: 8. /// public int ScriptExecutionThreadCount { get; set; } = 8; /// /// Max mirrored native alarms retained per source binding before older entries are dropped (logged). /// Default: 1000. /// public int MirroredAlarmCapPerSource { get; set; } = 1000; /// /// Interval in milliseconds to retry a failed native alarm subscription. /// Default: 5000ms. /// public int NativeAlarmRetryIntervalMs { get; set; } = 5000; /// HTTP timeout (seconds) for fetching a deployment config from central (notify-and-fetch). public int ConfigFetchTimeoutSeconds { get; set; } = 30; /// /// Bounded attempt count (including the first) for the standby's replicated-config /// fetch; a 2 s fixed delay separates attempts and superseded fetches never retry. /// Consumed by SiteReplicationActor.HandleApplyConfigDeploy (UA2). Default: 3. /// public int ConfigFetchRetryCount { get; set; } = 3; /// /// Fixed interval (ms) at which an Instance Actor re-sends a tag-subscribe /// request that either failed or whose response was lost (S4/UA6). The retry is /// armed on every send and cancelled on the first Success reply, so it closes /// both the failed-response and the lost-response gaps. Default: 5000ms. /// public int TagSubscribeRetryIntervalMs { get; set; } = 5000; /// /// Grace period (ms) after a script's execution timeout elapses before the /// stuck-script watchdog declares the script's dedicated thread blocked and /// emits a loud site event naming it (S2). The CTS timeout only requests /// cooperative cancellation; a script blocked in synchronous I/O never /// observes it, so this watchdog is the only operator signal that one of the /// bounded script-execution threads is gone. Default: 30000ms. /// public int StuckScriptGraceMs { get; set; } = 30000; }