private async Task DeleteScannerAsyncInternal(string tableName, ScannerInformation scannerInfo, RequestOptions options) { using (Response webResponse = await DeleteRequestAsync <Scanner>(tableName + "/scanner/" + scannerInfo.ScannerId, null, options)) { if (webResponse.WebResponse.StatusCode != HttpStatusCode.OK) { using (var output = new StreamReader(webResponse.WebResponse.GetResponseStream())) { string 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)); } } } }
/// <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))); }
/// <summary> /// Scans the next set of messages. /// </summary> /// <param name="scannerInfo">the scanner information retrieved by #CreateScanner()</param> /// <returns>a cellset, or null if the scanner is exhausted</returns> public async Task <CellSet> ScannerGetNextAsync(ScannerInformation scannerInfo) { return(await ScannerGetNextAsyncInternal(scannerInfo)); }
/// <summary> /// Scans the next set of messages. /// </summary> /// <param name="scannerInfo">the scanner information retrieved by #CreateScanner()</param> /// <returns>a cellset, or null if the scanner is exhausted</returns> public CellSet ScannerGetNext(ScannerInformation scannerInfo) { return(ExecuteAndGetWithVirtualNetworkLoadBalancing <ScannerInformation, CellSet>(ScannerGetNextAsyncInternal, scannerInfo)); }