0

Hi i am basically doing a Mobile Website in MVC 4 and a WEP API within one project. The mobile website will have access and features to control the backend WEP API.

The end users will use native mobile app.

My problem: The web api handles a array containing items of information. Now i want to run a thread emptying the array(queue), any suggestions on how is the most feasible way to do it?

4

1 回答 1

3

如果需要使用该数组对在后端运行的 Web Api 进行 Fire and Forget 调用。您可以使用 HttpClient 库,它已经提供了一个基于任务的模型来进行异步调用,并在 MVC 控制器操作中使用类似的东西

HttpClient client = new HttpClient();
Task.Factory.StartNew(() => client.PostAsync(...));
于 2013-07-11T14:06:25.403 回答