/// <summary>
 /// Initiates the asynchronous execution of the ExecuteBatchGet operation.
 /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchGet"/>
 /// </summary>
 /// <param name="batches">Configured BatchGet objects</param>
 /// <param name="callback">An AmazonDynamoCallback 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>void</returns>
 public void ExecuteBatchGetAsync(BatchGet[] batches, AmazonDynamoCallback <VoidResponse> callback, object state)
 {
     DynamoDBAsyncExecutor.AsyncOperation <VoidResponse>(() =>
     {
         MultiTableBatchGet superBatch = new MultiTableBatchGet(batches);
         superBatch.ExecuteHelper(true);
         return(new VoidResponse());
     }, "ExecuteBatchGetAsync", callback, state);
 }
Example #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the ExecuteBatchGet operation.
        /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchGet"/>
        /// </summary>
        /// <param name="batches">Configured BatchGet objects</param>
        /// <param name="callback">The callback that will be invoked when the asynchronous operation completes.</param>
        /// <param name="asyncOptions">An instance of AsyncOptions that specifies how the async method should be executed.</param>
        public void ExecuteBatchGetAsync <T>(BatchGet[] batches, AmazonDynamoDBCallback callback, AsyncOptions asyncOptions = null)
        {
            asyncOptions = asyncOptions ?? new AsyncOptions();
            MultiTableBatchGet superBatch = new MultiTableBatchGet(batches);

            DynamoDBAsyncExecutor.ExecuteAsync(
                () => { superBatch.ExecuteHelper(true); },
                asyncOptions,
                callback);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ExecuteBatchGet operation.
        /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchGet"/>
        /// </summary>
        /// <param name="batches">Configured BatchGet objects</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 EndExecuteBatchGet
        ///         operation.</returns>
        public IAsyncResult BeginExecuteBatchGet(BatchGet[] batches, AsyncCallback callback, object state)
        {
            MultiTableBatchGet superBatch = new MultiTableBatchGet(batches);

            return(DynamoDBAsyncExecutor.BeginOperation(() => { superBatch.ExecuteHelper(); return null; }, callback, state));
        }