I have a list of http commands which need to be executed in a particular order.
Let cmd = [
(Get, "http://login.xxx.com");
(Post, "http://login.xxx.com", "login=name;password=pwd");
....]
cmd |> List.map (crawl)
Will the crawl always run the http requests top-down (even in a multiple core computer)? What’s the best way to force the executing order if it cannot be guaranteed?
Yes, List.map is single threaded so the order of execution is guaranteed. You just need to ensure your crawl function doesn’t lanch asynchonous fire and forget operations, this is probably already the case as it’s the simplest way do things, i.e. ensure you use
WebClient.DownloadStringnot the async version.