示例#1
0
 private async Task DeleteScannerAsyncInternal(string tableName, ScannerInformation scannerInfo,
                                               RequestOptions options)
 {
     using (var webResponse =
                await DeleteRequestAsync <Scanner>(tableName + "/scanner/" + scannerInfo.ScannerId, null, options))
     {
         if (webResponse.WebResponse.StatusCode != HttpStatusCode.OK)
         {
             using (var output = new StreamReader(webResponse.WebResponse.GetResponseStream()))
             {
                 var message = output.ReadToEnd();
                 throw new WebException(
                           string.Format(
                               "Couldn't delete scanner {0} associated with {1} table.! Response code was: {2}, expected 200! Response body was: {3}",
                               scannerInfo.ScannerId,
                               tableName,
                               webResponse.WebResponse.StatusCode,
                               message));
             }
         }
     }
 }
示例#2
0
 /// <summary>
 /// Scans the next set of messages.
 /// </summary>
 /// <param name="scannerInfo">the scanner information retrieved by #CreateScanner()</param>
 /// <param name="options">
 /// the request options, scan requests must set endpoint(Gateway mode) or host(VNET mode) to receive
 /// the scan request
 /// </param>
 /// <returns>a cellset, or null if the scanner is exhausted</returns>
 public async Task <CellSet> ScannerGetNextAsync(ScannerInformation scannerInfo, RequestOptions options)
 {
     scannerInfo.ArgumentNotNull("scannerInfo");
     options.ArgumentNotNull("options");
     return(await options.RetryPolicy.ExecuteAsync(() => ScannerGetNextAsyncInternal(scannerInfo, options)));
 }