public async Task ResumeRuntime(TimeSpan timeout)
 {
     if (_useAsync)
     {
         using CancellationTokenSource cancellation = new CancellationTokenSource(timeout);
         await _client.ResumeRuntimeAsync(cancellation.Token).ConfigureAwait(false);
     }
     else
     {
         _client.ResumeRuntime();
     }
 }
예제 #2
0
        private void ResumeRuntime(IpcEndpointInfo info)
        {
            var client = new DiagnosticsClient(info.Endpoint);

            _outputHelper.WriteLine($"{info.RuntimeInstanceCookie}: Resuming runtime instance.");
            try
            {
                client.ResumeRuntime();
                _outputHelper.WriteLine($"{info.RuntimeInstanceCookie}: Resumed successfully.");
            }
            catch (ServerErrorException ex)
            {
                // Runtime likely does not understand the ResumeRuntime command.
                _outputHelper.WriteLine($"{info.RuntimeInstanceCookie}: {ex.Message}");
            }
        }