Created
April 26, 2013 15:39
-
-
Save parmarnishant/5468199 to your computer and use it in GitHub Desktop.
Revisions
-
parmarnishant created this gist
Apr 26, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ IEnumerable<Task<Image>> tasks = s_Domains.Select(GetFavicon); // The IEnumerable from Select is lazy, so evaluate it to start the tasks tasks = tasks.ToList(); Task<Image[]> allTask = Task.WhenAll(tasks); Then, all we have left to do is await the allTask, and use its results: Image[] images = await allTask; foreach (Image eachImage in images) { AddAFavicon(eachImage); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ _