Beispiel #1
0
        private async Task <ResultSet> ScanResultSetAsyncAwaited(IOBehavior ioBehavior, ResultSet resultSet, CancellationToken cancellationToken)
        {
            using (Command.RegisterCancel(cancellationToken))
            {
                try
                {
                    m_resultSetBuffered = await resultSet.ReadResultSetHeaderAsync(ioBehavior).ConfigureAwait(false);

                    return(m_resultSetBuffered);
                }
                catch (MySqlException ex) when(ex.Number == (int)MySqlErrorCode.QueryInterrupted)
                {
                    m_resultSetBuffered = null;
                    cancellationToken.ThrowIfCancellationRequested();
                    throw;
                }
            }
        }
        private async Task <ResultSet> ScanResultSetAsyncAwaited(IOBehavior ioBehavior, ResultSet resultSet, CancellationToken cancellationToken)
        {
            m_resultSetBuffered = await resultSet.ReadResultSetHeaderAsync(ioBehavior, cancellationToken);

            return(m_resultSetBuffered);
        }