/// <summary> /// Initiates the asynchronous execution of the ExecuteBatchWrite operation. /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchWrite"/> /// </summary> /// <param name="batches">Configured BatchWrite 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 ExecuteBatchWriteAsync(BatchWrite[] batches, AmazonDynamoCallback <VoidResponse> callback, object state) { DynamoDBAsyncExecutor.AsyncOperation <VoidResponse>(() => { MultiTableBatchWrite superBatch = new MultiTableBatchWrite(batches); superBatch.ExecuteHelper(true); return(new VoidResponse()); }, "ExecuteBatchWriteAsync", callback, state); }
/// <summary> /// Initiates the asynchronous execution of the ExecuteBatchWrite operation. /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchWrite"/> /// </summary> /// <param name="batches">Configured BatchWrite 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 ExecuteBatchWriteAsync <T>(BatchWrite[] batches, AmazonDynamoDBCallback callback, AsyncOptions asyncOptions = null) { asyncOptions = asyncOptions ?? new AsyncOptions(); MultiTableBatchWrite superBatch = new MultiTableBatchWrite(batches); DynamoDBAsyncExecutor.ExecuteAsync( () => { superBatch.ExecuteHelper(true); }, asyncOptions, callback); }
/// <summary> /// Initiates the asynchronous execution of the ExecuteBatchWrite operation. /// <seealso cref="Amazon.DynamoDBv2.DataModel.DynamoDBContext.ExecuteBatchWrite"/> /// </summary> /// <param name="batches">Configured BatchWrite 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 EndDelete /// operation.</returns> public IAsyncResult BeginExecuteBatchWrite(BatchWrite[] batches, AsyncCallback callback, object state) { MultiTableBatchWrite superBatch = new MultiTableBatchWrite(batches); return(DynamoDBAsyncExecutor.BeginOperation(() => { superBatch.ExecuteHelper(); return null; }, callback, state)); }