并行执行的Web服务调用Web

由网友(时光成歌i)分享简介:我看到这些问题的Recommendations在ASP.NET 和Async.Parallel或Array.Parallel.Map 从大约一年前,想知道是否从他们的建议仍然有效,或者如果有现在的任务并行库。I saw these questions Recommendations for executing .NE...

我看到这些问题的Recommendations在ASP.NET 和Async.Parallel或Array.Parallel.Map 从大约一年前,想知道是否从他们的建议仍然有效,或者如果有现在的任务并行库。

I saw these questions Recommendations for executing .NET HttpWebRequests in parallel in ASP.NET and Async.Parallel or Array.Parallel.Map from about a year ago and was wondering if the advice from them still stands or if there's now a better approach with Task Parallel Library.

我的情况更接近第二个问题,但我只需要打,而不是同一台3000倍10(ISH)不同的网络服务。由于这是一个Web应用程序,并那种要求放大更改建议的方法呢?有没有更好的方式来走?我怎么也能期待这样的规模随着用户数量的增加?

My case is closer to the second question, except I only need to hit 10(ish) different web-services instead of the same one 3000 times. As this is a web application, does that kind of request amplification change the suggested approach? Is there a better approach to take? How well can I expect something like this to scale as the number of users increases?

的几个注意事项:

在缓存的结果将是下一个实现细节,但我想获得的基本功能工作的第一个 在每个Web服务的回报非常少的数据(下KB),最长的一次时间不超过3秒钟返回,我相信大多就是延迟(产生的结果不计算成本) 从客户端调用网络服务将无法正常工作(我不认为),因为有些是在不同的域 无论是C#F#实现将工作作为理想,这将抽象出来一个方法调用,需要一个字符串并返回的集合字符串取值 Caching results will be the next implementation detail, but I would like to get the base functionality working first Each web-service returns very little data (under a kb), longest one takes no more than 3 seconds to return and I believe most of that is latency (generating results not computationally expensive) Calling web-services from the client won't work (I don't think) as some are in different domains Either C# of F# implementation would work as ideally this will be abstracted away to a method call that takes a string and returns a collection of strings

推荐答案

您可以找到相关的讨论:Async而不是并行

You might find this discussion relevant:Async instead of Parallel

阅读全文

相关推荐

最新文章