internal override Task <bool> NextAsync() { if (isClosed) { throw new SnowflakeDbException(SFError.DATA_READER_ALREADY_CLOSED); } _currentChunkRowIdx++; if (_currentChunkRowIdx < _currentChunkRowCount) { return(Task.FromResult(true)); } if (_chunkDownloader != null) { // GetNextChunk could be blocked if download result is not done yet. // So put this piece of code in a seperate task return(Task.Run(() => { Logger.Info("Get next chunk from chunk downloader"); SFResultChunk nextChunk; if ((nextChunk = _chunkDownloader.GetNextChunk()) != null) { resetChunkInfo(nextChunk); return true; } else { return false; } })); } return(Task.FromResult(false)); }
internal override bool Next() { if (isClosed) { throw new SnowflakeDbException(SFError.DATA_READER_ALREADY_CLOSED); } _currentChunkRowIdx++; if (_currentChunkRowIdx < _currentChunkRowCount) { return(true); } SFResultChunk nextChunk; if ((nextChunk = _chunkDownloader?.GetNextChunk()) != null) { resetChunkInfo(nextChunk); return(true); } return(false); }