Giả sử tôi có hai chức năng:F # sử dụng Async.Parallel để chạy 2 nhiệm vụ song song
let dowork n =
async {
do printfn "work %d" n
}
let work i = async {
do! Async.Sleep(2000)
printfn "work finished %d" i }
Làm thế nào tôi sẽ sử dụng Async.Parallel để chạy chúng trùng nhau và đợi cho cả hai để kết thúc trước khi tiếp tục?
dups thể, http://stackoverflow.com/questions/5693279/combining-f- async-functions, http://stackoverflow.com/questions/4106846/how-to-wait-for-async-to-finish – gradbot