/// <summary> /// Initiates the asynchronous execution to get all the remaining results from DynamoDB. /// </summary> /// <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 EndGetRemaining /// operation.</returns> public IAsyncResult BeginGetRemaining(AsyncCallback callback, object state) { return(DynamoDBAsyncExecutor.BeginOperation(() => { var documents = DocumentSearch.GetRemainingHelper(true); List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList(); return items; }, callback, state)); }
/// <summary> /// Initiates the asynchronous execution to get all the remaining results from DynamoDB. /// </summary> /// <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 EndGetRemaining /// operation.</returns> public void GetRemainingAsync(AmazonDynamoCallback <List <T> > callback, object state) { DynamoDBAsyncExecutor.AsyncOperation(() => { var documents = DocumentSearch.GetRemainingHelper(true); List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList(); return(items); }, "GetRemainingAsync", callback, state); }
/// <summary> /// Initiates the asynchronous execution to get all the remaining results from DynamoDB. /// </summary> /// <param name="cancellationToken">Token which can be used to cancel the task.</param> /// <returns> /// A Task that can be used to poll or wait for results, or both. /// Results will include the remaining result items from DynamoDB. /// </returns> public Task <List <T> > GetRemainingAsync(CancellationToken cancellationToken = default(CancellationToken)) { return(AsyncRunner.Run(() => { var documents = DocumentSearch.GetRemainingHelper(true); List <T> items = SourceContext.FromDocuments <T>(documents).ToList(); return items; }, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution to get all the remaining results from DynamoDB. /// </summary> /// <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 GetRemainingAsync(AmazonDynamoDBCallback <List <T> > callback, AsyncOptions asyncOptions = null) { asyncOptions = asyncOptions ?? new AsyncOptions(); DynamoDBAsyncExecutor.ExecuteAsync <List <T> >( () => { var documents = DocumentSearch.GetRemainingHelper(true); List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList(); return(items); }, asyncOptions, callback); }