Skip to content

Instantly share code, notes, and snippets.

@mikhailshilkov
Created December 19, 2018 23:01
Show Gist options
  • Save mikhailshilkov/1c7d9df2ae5bf8c98f0503dde85b71a9 to your computer and use it in GitHub Desktop.
Save mikhailshilkov/1c7d9df2ae5bf8c98f0503dde85b71a9 to your computer and use it in GitHub Desktop.
// 1. Simple sequencing of activities
let Run([<OrchestrationTrigger>] context: DurableOrchestrationContext) = task {
let! hello1 = context.CallActivityAsync<string>("E1_SayHello", "Tokyo")
let! hello2 = context.CallActivityAsync<string>("E1_SayHello", "Seattle")
let! hello3 = context.CallActivityAsync<string>("E1_SayHello", "London")
return [hello1; hello2; hello3]
}
// 2. Parallel calls snippet
let tasks = Array.map (fun f -> context.CallActivityAsync<int64>("E2_CopyFileToBlob", f)) files
let! results = Task.WhenAll tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment