Part2ã£ã¦ãPart1ã¯ãã£ãã®ãã¨ããã¨ããã¼ããéåææ代ã®LINQãããªâ¦â¦ï¼ãã¦ãä»åã¯ForEachããã¼ãã§ããã¨ãã£ã¦ãããã£ã¦Select+WhenAllã§ããï¼ãSelectã¯éåææ代ã®ForEachãã£ã¦è¨ã£ã¦ããããªããã¨ããã¨ãã¯ããè¨ã£ã¦ã¾ãããã¾ã ä»ã«è¨ããã¨ããã®ï¼ã¨ããã¨ãä¾ãã°ä»¥ä¸ã®ã·ãã¥ã¨ã¼ã·ã§ã³ã var httpClient = new HttpClient(); var tasks = Enumerable.Range(1, 100000) .Select(async x => { var str = await httpClient.GetStringAsync("http://hogehoge?q=" + x); Console.WriteLine(str); }); await Task.WhenAll(tasks); å¥ã«åãã¯ãã¾ã
{{#tags}}- {{label}}
{{/tags}}