Exemple #1
0
        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");
        }
Exemple #2
0
 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"));
 }
Exemple #3
0
        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();
        }
Exemple #4
0
        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();
        }