You are developing a C# (.NET Isolated process) Durable Function to transcode and analyze video files. The workflow implements a Fan-out/Fan-in pattern: it first calls a transcoding activity, then launches parallel analysis activities on the transcoded video, and finally aggregates the results.
To ensure the durability of the execution, the Durable Functions runtime uses event sourcing and replays the orchestrator function.
You need to sequence the lifecycle and replay steps of this workflow from the initial client request to the completion of the orchestration.
In which order do these events occur during the execution of this workflow?
- 1An HTTP-triggered client function starts the orchestration using the Durable Task client and returns an HTTP 202 response containing status query URIs.
- 2The orchestrator function begins execution, schedules the transcoding activity function, and yields control when the activity task is awaited.
- 3The transcoding activity completes; the runtime restarts the orchestrator, which replays execution and retrieves the transcoding result from history without re-running the activity.
- 4The orchestrator schedules multiple analysis activities in parallel, aggregates their task objects, and yields control by awaiting Task.WhenAll.
- 5All parallel analysis activities finish; the orchestrator restarts, replays history, runs the final aggregation activity, and transitions to the Completed state.
Cevap
The correct order of events starts with the client launching the orchestration, followed by the orchestrator initiating execution and yielding at the transcoding task. Once completed, the orchestrator replays to resolve the transcoding result and then invokes the parallel analysis activities, yielding on their concurrent execution. Finally, after all analysis tasks finish, the orchestrator replays a last time to retrieve their values, runs the aggregation activity, and finishes.
The execution begins with the client starting the orchestration. The orchestrator runs and yields at the first await (transcoding). After the transcode completes, the orchestrator replays the function, retrieves the transcoding result from history, runs the parallel tasks, and yields again. Once the parallel tasks complete, the orchestrator replays to obtain all analysis results, runs the final aggregation activity, and completes.
Adım Adım Çözüm
Anahtar Kavram
Durable Functions Orchestrator Replay and Execution Lifecycle