Imagine I have an async function that takes data from an url and outputs it to a file, and an async function that calls the first function for a list of urls, like this:
static async Task UrlToFileAsync(Uri url, string filePath)
{
//...
}
public static async Task GetDataAsync(List<Uri> urlList, string filePath)
{
foreach (Uri url in urlList)
{
await UrlToFileAsync(url, filePath);
}
}
My question is, will the Task from GetDataAsync only be considered completed when the Task for each url called in the loop is completed? Does the program creates an array or list of Tasks somewhere to monitor the state of each call of UrlToFileAsync?