Created
August 1, 2014 06:58
-
-
Save CayasSoftware/1713bf3394742024b8ca to your computer and use it in GitHub Desktop.
Unterschiedliche Ergebnisse zwischen Task.WhenAll und einem awaited Task
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 characters
var tweets = await GetTweetsTaskAsync(); // 5 |
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 characters
var twitterTask = GetTweetsTaskAsync(); | |
var weatherTask = GetWeather(); | |
await Task.WhenAll(new Task[]{twitterTask, weatherTask}); | |
var tweets = twitterTask.Result; //1 |
Hast du noch die Signaturen von GetTweetTaskAsync und GetWeather?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Das
new Task[] {}
kannst du dir sogar sparen,params
ist gesetzt.