c# - Handle cancelled task and task exceptions in Task.WaitAll? -
I am using TPL to crawl a set of URLs and then processing something. {{......}); } Work. Wait all (work);
The issue is that You can easily get the You may also be able to do this as an extension method on Tasks. Waiting seems like it will often throw an exception because a work has been canceled. I understand that
httpclient.getStringAsync can not always ensure success, so if I have an exception I would like to add a retrain log in
httpClient.GetStringAsync . To do this, what would be the appropriate approach
GetStringAsync For code> with loop, which is no exception or tries to reach again the limit of effort. I store the work and I am using it for the
wait if I reach the retrace limit without success, the exception will be redone:
Async Tasks & lt; String & gt; GetStringAsync (HTTP Client Client, String URL, Intit Retrieves) {Task & Lt; String & gt; Work = null; For (Int i = 0; I
HttpClient :
Fixed async Tasks & lt ; String & gt; GetStringAsync (This HttpClient Client, String URL, Intit Retrieves);
Comments
Post a Comment