コード例 #1
0
 /// <summary>
 /// Initiates the asynchronous execution to get the next set of 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 EndGetNextSet
 ///         operation.</returns>
 public IAsyncResult BeginGetNextSet(AsyncCallback callback, object state)
 {
     return(DynamoDBAsyncExecutor.BeginOperation(() =>
     {
         var documents = DocumentSearch.GetNextSetHelper(true);
         List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList();
         return items;
     }, callback, state));
 }
コード例 #2
0
 /// <summary>
 /// Initiates the asynchronous execution to get the next set of results from DynamoDB.
 /// List<T> is returned in the result.Response
 /// </summary>
 /// <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 GetNextSetAsync(AmazonDynamoCallback <List <T> > callback, object state)
 {
     DynamoDBAsyncExecutor.AsyncOperation(() =>
     {
         var documents  = DocumentSearch.GetNextSetHelper(true);
         List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList();
         return(items);
     }, "GetNextSetAsync", callback, state);
 }
コード例 #3
0
 /// <summary>
 /// Initiates the asynchronous execution to get the next set of 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 next set of result items from DynamoDB.
 /// </returns>
 public Task <List <T> > GetNextSetAsync(CancellationToken cancellationToken = default(CancellationToken))
 {
     return(AsyncRunner.Run(() =>
     {
         var documents = DocumentSearch.GetNextSetHelper(true);
         List <T> items = SourceContext.FromDocuments <T>(documents).ToList();
         return items;
     }, cancellationToken));
 }
コード例 #4
0
 /// <summary>
 /// Initiates the asynchronous execution to get the next set of 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 GetNextSetAsync(AmazonDynamoDBCallback <List <T> > callback, AsyncOptions asyncOptions = null)
 {
     asyncOptions = asyncOptions ?? new AsyncOptions();
     DynamoDBAsyncExecutor.ExecuteAsync <List <T> >(
         () =>
     {
         var documents  = DocumentSearch.GetNextSetHelper(true);
         List <T> items = SourceContext.FromDocumentsHelper <T>(documents, Config).ToList();
         return(items);
     },
         asyncOptions,
         callback);
 }