Created
March 19, 2016 20:04
-
-
Save jongio/dbdb2e6c62c0b5287449 to your computer and use it in GitHub Desktop.
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
public class GreetingsOrchestration2 : TaskOrchestration<string,int> | |
{ | |
public override async Task<string> RunTask(OrchestrationContext context, int secondsToWait) | |
{ | |
var user = context.ScheduleTask<string>("DurableTaskSamples.Greetings.GetUserTask", string.Empty); | |
var timer = context.CreateTimer<string>(context.CurrentUtcDateTime.AddSeconds(secondsToWait), "TimedOut"); | |
var u = await Task.WhenAny(user, timer); | |
string greeting = await context.ScheduleTask<string>("DurableTaskSamples.Greetings.SendGreetingTask", string.Empty, u.Result); | |
return greeting; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment