namespace ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Supervisor; /// /// Abstraction over the act of spawning a FOCAS Host process and obtaining an /// connected to it. Production wires this to a real /// Process.Start + FocasIpcClient.ConnectAsync; tests use a fake that /// exposes deterministic failure modes so the supervisor logic can be stressed /// without spawning actual exes. /// public interface IHostProcessLauncher { /// /// Spawn a new Host process (if one isn't already running) and return a live /// client session. Throws on unrecoverable errors; transient errors (e.g. Host /// not ready yet) should throw so the supervisor /// applies the backoff ladder. /// Task LaunchAsync(CancellationToken ct); /// /// Terminate the Host process if one is running. Called on Dispose and after a /// heartbeat loss is detected. /// Task TerminateAsync(CancellationToken ct); /// /// true when the most recently spawned Host process is still alive. /// Supervisor polls this at heartbeat cadence; going false without a /// clean shutdown counts as a crash. /// bool IsProcessAlive { get; } }