Beispiel #1
0
        /// <summary>
        /// Send a fetch result request to QLDB, retrieving the next chunk of data for the result.
        /// </summary>
        ///
        /// <param name="txnId">The unique ID of the transaction to execute.</param>
        /// <param name="nextPageToken">The token that indicates what the next expected page is.</param>
        ///
        /// <returns>The result of the <see cref="FetchPageRequest"/>.</returns>
        internal virtual FetchPageResult FetchPage(string txnId, string nextPageToken)
        {
            var fetchPageRequest = new FetchPageRequest
            {
                NextPageToken = nextPageToken,
                TransactionId = txnId,
            };
            var request = new SendCommandRequest
            {
                FetchPage = fetchPageRequest,
            };
            var response = this.SendCommand(request);

            return(response.FetchPage);
        }
        /// <summary>
        /// Send a fetch result request to QLDB, retrieving the next chunk of data for the result.
        /// </summary>
        ///
        /// <param name="txnId">The unique ID of the transaction to execute.</param>
        /// <param name="nextPageToken">The token that indicates what the next expected page is.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The result of the <see cref="FetchPageRequest"/>.</returns>
        internal virtual async Task <FetchPageResult> FetchPage(string txnId, string nextPageToken, CancellationToken cancellationToken = default)
        {
            var fetchPageRequest = new FetchPageRequest
            {
                TransactionId = txnId,
                NextPageToken = nextPageToken,
            };
            var request = new SendCommandRequest
            {
                FetchPage = fetchPageRequest,
            };
            var response = await this.SendCommand(request, cancellationToken);

            return(response.FetchPage);
        }