Last active
August 29, 2015 14:07
-
-
Save Redth/91a8c4b9f29a1312d3f5 to your computer and use it in GitHub Desktop.
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 toSend = from n in Broker.TakeMany () | |
select Connection.Send (n); | |
await Task.WhenAll (toSend).ConfigureAwait (false); | |
foreach (var t in toSend) { | |
await t; //Probably a no-op, should return immediately in any case | |
if (t.Exception != null) | |
Broker.RaiseNotificationSucceeded (null); // Need to pass back 'n' here | |
else | |
Broker.RaiseNotificationFailed (null, t.Exception); | |
} | |
// Connection.Send: | |
public async Task<INotification> Send (INotification notification) | |
{ | |
await Task.Delay (500).ConfigureAwait (false); | |
return notification; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment