public async ValueTask DisposeAsync()
            {
                if (!_disposed)
                {
                    await _sourceStream.DisposeAsync();

                    _serviceScope.Dispose();
                    _disposed = true;
                }
            }
Exemple #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (_isCompleted)
            {
                if (disposing)
                {
                    _cancellationTokenSource.Cancel();
                    _serviceScope.Dispose();
                    _eventStream.Dispose();
                    _cancellationTokenSource.Dispose();
                }

                _isCompleted = true;
            }
        }