public async Task StopAsync(CancellationToken cancellationToken) { _logger.LogInformation("Shuttingdown Rpc Channels Manager"); _languageWorkerChannelManager.ShutdownChannels(); _languageWorkerChannelManager.ShutdownProcessRegistry(); await _rpcServer.KillAsync(); }
public async Task OuterStopAsync(CancellationToken cancellationToken) { _logger.LogDebug("Shutting down RPC server"); try { Task shutDownRpcServer = _rpcServer.ShutdownAsync(); Task shutdownResult = await Task.WhenAny(shutDownRpcServer, Task.Delay(_rpcServerShutdownTimeoutInMilliseconds)); if (!shutdownResult.Equals(shutDownRpcServer) || shutDownRpcServer.IsFaulted) { _logger.LogDebug("Killing RPC server"); await _rpcServer.KillAsync(); } } catch (AggregateException ae) { ae.Handle(e => { _logger.LogError(e, "Shutting down RPC server encountered exception: '{message}'", e.Message); return(true); }); } }
public async Task StopAsync(CancellationToken cancellationToken) { await _rpcServer.KillAsync(); }