コード例 #1
0
ファイル: AgQueueService.cs プロジェクト: masilver99/AgQueue
        public override async Task <CommitTransactionResponse> CommitTransaction(CommitTransactionRequest request, ServerCallContext context)
        {
            var(addCount, pullCount) = await this.internalApi.CommitTransaction(request.TransId);

            return(new CommitTransactionResponse {
                MessagesAdded = addCount, MessagesPulled = pullCount
            });
        }
コード例 #2
0
        /// <summary>
        /// Ends a SQL transaction started with the <code>BeginTransaction</code> operation and
        /// commits the changes.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CommitTransaction service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the CommitTransaction service method, as returned by RDSDataService.</returns>
        /// <exception cref="Amazon.RDSDataService.Model.BadRequestException">
        /// There is an error in the call or in a SQL statement.
        /// </exception>
        /// <exception cref="Amazon.RDSDataService.Model.ForbiddenException">
        /// There are insufficient privileges to make the call.
        /// </exception>
        /// <exception cref="Amazon.RDSDataService.Model.InternalServerErrorException">
        /// An internal error occurred.
        /// </exception>
        /// <exception cref="Amazon.RDSDataService.Model.NotFoundException">
        /// The <code>resourceArn</code>, <code>secretArn</code>, or <code>transactionId</code>
        /// value can't be found.
        /// </exception>
        /// <exception cref="Amazon.RDSDataService.Model.ServiceUnavailableErrorException">
        /// The service specified by the <code>resourceArn</code> parameter is not available.
        /// </exception>
        /// <exception cref="Amazon.RDSDataService.Model.StatementTimeoutException">
        /// The execution of the SQL statement timed out.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/rds-data-2018-08-01/CommitTransaction">REST API Reference for CommitTransaction Operation</seealso>
        public virtual Task <CommitTransactionResponse> CommitTransactionAsync(CommitTransactionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CommitTransactionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CommitTransactionResponseUnmarshaller.Instance;

            return(InvokeAsync <CommitTransactionResponse>(request, options, cancellationToken));
        }
コード例 #3
0
        internal virtual CommitTransactionResponse CommitTransaction(CommitTransactionRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CommitTransactionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CommitTransactionResponseUnmarshaller.Instance;

            return(Invoke <CommitTransactionResponse>(request, options));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the CommitTransaction operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CommitTransaction operation on AmazonRDSDataServiceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCommitTransaction
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/rds-data-2018-08-01/CommitTransaction">REST API Reference for CommitTransaction Operation</seealso>
        public virtual IAsyncResult BeginCommitTransaction(CommitTransactionRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CommitTransactionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CommitTransactionResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
コード例 #5
0
ファイル: Session.cs プロジェクト: R-maan/workflow
        /// <summary>
        /// Send a commit request to QLDB, committing any active changes and closing any open results.
        /// </summary>
        ///
        /// <param name="txnId">The unique ID of the transaction to commit.</param>
        /// <param name="commitDigest">The digest hash of the transaction to commit.</param>
        ///
        /// <returns>The result of the commit transaction request.</returns>
        ///
        /// <exception cref="OccConflictException">Thrown if an OCC conflict has been detected within the transaction.</exception>
        internal virtual CommitTransactionResult CommitTransaction(string txnId, MemoryStream commitDigest)
        {
            var commitTransactionRequest = new CommitTransactionRequest
            {
                TransactionId = txnId,
                CommitDigest  = commitDigest,
            };
            var request = new SendCommandRequest
            {
                CommitTransaction = commitTransactionRequest,
            };
            var response = this.SendCommand(request);

            return(response.CommitTransaction);
        }
コード例 #6
0
        /// <summary>
        /// Send a commit request to QLDB, committing any active changes and closing any open results.
        /// </summary>
        ///
        /// <param name="txnId">The unique ID of the transaction to commit.</param>
        /// <param name="commitDigest">The digest hash of the transaction to commit.</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 commit transaction request.</returns>
        ///
        /// <exception cref="OccConflictException">Thrown if an OCC conflict has been detected within the transaction.</exception>
        internal virtual async Task <CommitTransactionResult> CommitTransaction(string txnId, MemoryStream commitDigest, CancellationToken cancellationToken = default)
        {
            var commitTransactionRequest = new CommitTransactionRequest
            {
                TransactionId = txnId,
                CommitDigest  = commitDigest,
            };
            var request = new SendCommandRequest
            {
                CommitTransaction = commitTransactionRequest,
            };
            var response = await this.SendCommand(request, cancellationToken);

            return(response.CommitTransaction);
        }
コード例 #7
0
        public async Task <IActionResult> CommitTransaction([FromBody] CommitTransactionRequest request)
        {
            await this._transactionService.CommitTransactionAsync(request.Type, request.Amount);

            return(Ok());
        }