This question had an excellent answer on how to perform an asynchronous HttpWebRequest
.
I have a list of 50k+ URLs that I want to asynchronously fetch with this method. The issue I ran into is the main thread would complete and exit before all the async requests could finish.
I found ManualResetEvent
could be used to WaitOne()
, and to call Set()
on the call back method. This would work great if I was only doing one request. Not sure how to handle this for many requests.