您的位置:首页 > 编程语言 > C#

C# 异步

2016-06-03 14:33 423 查看
private void GetHttpResponse()
{
var client = new Microsoft.HBase.Client.HBaseClient(new ClusterCredentials(new Uri("https://cncloudhbjiaoyi.azurehdinsight.cn"), "admin", "Capitalandcs2016."));

//定义扫描设定
Scanner scannerSettings = new Scanner() { };
//定义请求设定
RequestOptions option = RequestOptions.GetDefaultOptions();

var task = client.CreateScannerAsync("starinfocoupon", scannerSettings, option);
task.ContinueWith(x => ShowResult(x.Result,client,option));

}

private void ShowResult(ScannerInformation result,HBaseClient client, RequestOptions option)
{
var scan = result;

//扫描
CellSet next = null;
while ((next = client.ScannerGetNextAsync(scan, option).Result) != null)
{
foreach (CellSet.Row row in next.rows) { }
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: