/// <summary> /// Issues a batch-get request with multiple batches. /// /// Results are stored in the individual batches. /// </summary> /// <param name="batches"> /// Configured BatchGet objects /// </param> internal void ExecuteBatchGet(params BatchGet[] batches) { DynamoDBAsyncExecutor.IsMainThread("ExecuteBatchGetAsync"); MultiTableBatchGet superBatch = new MultiTableBatchGet(batches); superBatch.Execute(); }
/// <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); }
/// <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> /// Issues a batch-get request with multiple batches. /// /// Results are stored in the individual batches. /// </summary> /// <param name="batches"> /// Configured BatchGet objects /// </param> public void ExecuteBatchGet(params BatchGet[] batches) { MultiTableBatchGet superBatch = new MultiTableBatchGet(batches); superBatch.Execute(); }
/// <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)); }
/// <summary> /// Issues a batch-get request with multiple batches. /// /// Results are stored in the individual batches. /// </summary> /// <param name="batches"> /// Configured BatchGet objects /// </param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task ExecuteBatchGetAsync(BatchGet[] batches, CancellationToken cancellationToken = default(CancellationToken)) { MultiTableBatchGet superBatch = new MultiTableBatchGet(batches); return(superBatch.ExecuteAsync(cancellationToken)); }