public override async Task Start(string args) { await _process.Start($"{args} --InitializationPipeName {_ipcConnection.ConnectionId}"); try { await _ipcConnection.Connect().Timeout(_config.IpcConnectTimeout, $"Connecting to initialization pipe has timed out, make sure that the app {this.Identity} is connecting to the same pipe"); Trace.TraceInformation($"Yams is waiting for the app {this.Identity} to finish initializing"); string msg = await _ipcConnection.ReadMessage() .Timeout(_config.AppInitTimeout, $"Did not receive initialized message from the app {ExePath}"); if (msg != "[INITIALIZE_DONE]") { throw new InvalidOperationException($"Unexpected message '{msg}' received from app {this.Identity}"); } } catch (Exception) { await Kill(); throw; } Trace.TraceInformation($"Received initialized message from App {this.Identity}; App is ready to receive requests"); }
public override async Task Start(string args) { var startProcessTask = _process.Start($"{args} --ExitPipeName {_ipcConnection.ConnectionId}"); await Task.WhenAll(startProcessTask, _ipcConnection.Connect().Timeout(_config.IpcConnectTimeout, "Connecting to graceful exit pipe has timed out, make sure that the app is connecting to the same pipe")); }
public override async Task Start(string args) { await _process.Start($"{args} --HealthPipeName {_ipcConnection.ConnectionId}"); await _ipcConnection.Connect().Timeout(_config.IpcConnectTimeout, "Connecting to health pipe has timed out, make sure that the app is connecting to the same pipe"); MonitorProcessHealth(); }
public async Task Connect() { Trace.TraceInformation($"Connecting IPC connections.."); if (_initConnection != null) { await _initConnection.Connect().Timeout(_config.ConnectTimeout, "IPC Monitored Initialization connection failed to connect"); Trace.TraceInformation("IPC Monitored Initialization connection connected!"); } if (_exitConnection != null) { await _exitConnection.Connect().Timeout(_config.ConnectTimeout, "IPC Graceful Shutdown connection failed to connect"); Trace.TraceInformation("IPC Graceful Shutdown connection connected!"); } if (_healthConnection != null) { await _healthConnection.Connect().Timeout(_config.ConnectTimeout, "IPC Health connection failed to connect"); Trace.TraceInformation("IPC Health connection connected!"); } _waitForExit = WaitForExit(); }