【发布时间】:2018-01-07 20:41:08
【问题描述】:
我使用 jquery ajax 调用向我的 asp.net mvc 应用程序发送多个请求。处理此请求的方法是异步的,它在我的 oracle 数据库上执行查询。但这些查询不会并行发送到数据库。为什么不并行发送它们?这是异步控制器方法:
public async Task<int> GetVoltageRowCount(pLayerName)
{
DataWrapper featuresDataWrapper = new DataWrapper(pLayerName);
int rowCount = await Task.Factory.StartNew<int>(() => featuresDataWrapper.GetRowCount());
return rowCount;
}
这是客户请求。 (并行发送) jquery ajax request 这是 V$SQL oracle 表。发送所有请求大约需要 34 秒。 V$SQL table
【问题讨论】:
标签: jquery asp.net-mvc async-await