コード例 #1
0
        private async Task DisposeInternalAsync()
        {
            await _receiveProcess.TerminateAsync().HandleExceptionsAsync();

            IEnumerable <IProxy> proxies;

            lock (_proxyLock)
            {
                proxies = _proxies.Values.ToList();
            }

            await Task.WhenAll(proxies.Select(p => p.DisposeAsync())).HandleExceptionsAsync();
        }
コード例 #2
0
        private async Task DisposeInternalAsync()
        {
            try
            {
                // Cancel the initialization
                _cancellationSource.Cancel();
                try
                {
                    await _initialization;
                }
                catch (OperationCanceledException) { }

                await _snapshotProcess.TerminateAsync();
            }
            catch (OperationCanceledException) { }
            catch (Exception exc)
            {
                _disposalSource.SetException(exc);
                return;
            }

            _disposalSource.SetResult(0);
        }
コード例 #3
0
 public Task TerminateAsync(CancellationToken cancellation)
 {
     return(_dynamicProcess.TerminateAsync(cancellation));
 }