Created
July 29, 2014 12:40
-
-
Save tomorgan/f76bdfd3d01b49180b68 to your computer and use it in GitHub Desktop.
Asynchronous Lambda Expression Example
This file contains 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
private void MyMethod() { | |
//do some stuff | |
var flow = GetFlowFromSomewhere(); | |
var message = GetMessageFromSomewhere(); | |
flow.BeginSendInstantMessage(message, result => | |
{ | |
try | |
{ | |
flow.EndSendInstantMessage(result) | |
} | |
catch (Exception ex) | |
{ | |
//do something with this error | |
} | |
},null); | |
//do some other things.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment