Skip to content

Instantly share code, notes, and snippets.

@mvacha
Created September 18, 2016 21:40
Show Gist options
  • Save mvacha/bd01982a0d0ccc98557e980aaade58a4 to your computer and use it in GitHub Desktop.
Save mvacha/bd01982a0d0ccc98557e980aaade58a4 to your computer and use it in GitHub Desktop.
var result = await _connectedTCS.Task.FailOnCancel()
.OnSuccess(async () => await _userStatusTCS.Task.FailOnCancel())
.OnSuccess(async () => await _profileTCS.Task.FailOnCancel());
result.OnSuccess(() =>
{
Log.Info("Connecting to the Gateway successful");
connectedSuccessfully = true;
RootNode = _profileTCS.Task.Result.Value;
connectedEvent.Set();
})
.OnFailure((res) =>
{
Log.Error("Error when connecting to the Gateway " + res.Error);
connectedEvent.Set();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment