You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/durable-task-scheduler/quickstart-portable-durable-task-sdks.md
+92-64Lines changed: 92 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Since the example code automatically uses the default emulator settings, you don
113
113
1. Run the emulator. The container may take a few seconds to be ready.
114
114
115
115
```bash
116
-
docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:v0.0.6
116
+
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:v0.0.6
117
117
```
118
118
119
119
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables.
@@ -139,7 +139,7 @@ Since the example code automatically uses the default emulator settings, you don
139
139
1. Run the emulator. The container may take a few seconds to be ready.
140
140
141
141
```bash
142
-
docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:v0.0.6
142
+
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:v0.0.6
143
143
```
144
144
145
145
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables.
@@ -331,58 +331,31 @@ Orchestration completed with status: COMPLETED
331
331
332
332
::: zone pivot="java"
333
333
334
-
1. Install the required packages.
335
-
336
-
```bash
337
-
338
-
```
339
-
340
-
1. Start the worker.
341
-
342
-
```bash
343
-
344
-
```
345
-
346
-
1. In a new terminal, run the client.
347
-
348
-
```bash
349
-
350
-
```
351
-
352
-
You can provide the number of work items as an argument. If no argument is provided, the example runs 10 items by default.
334
+
From the `fan-out-fan-in` directory, build and run the application using Gradle.
353
335
354
-
```bash
355
-
356
-
```
336
+
```bash
337
+
./gradlew runFanOutFanInPattern
338
+
```
357
339
358
340
### Understanding the output
359
341
360
-
When you run this sample, you receive output from both the worker and client processes.
361
-
362
-
#### Worker output
363
-
364
-
The worker output shows:
342
+
When you run this sample, you receive output that shows:
365
343
366
344
- Registration of the orchestrator and activities.
367
345
- Status messages when processing each work item in parallel, showing that they're executing concurrently.
368
346
- Random delays for each work item (between 0.5 and 2 seconds) to simulate varying processing times.
369
347
- A final message showing the aggregation of results.
370
348
371
-
#### Client output
372
-
373
-
The client output shows:
374
-
375
-
- Starting the orchestration with the specified number of work items.
376
-
- The unique orchestration instance ID.
377
-
- The final aggregated result, which includes:
378
-
- Total number of items processed
379
-
- Sum of all results (each item result is the square of its value)
380
-
- Average of all results
381
-
382
349
#### Example output
383
350
384
351
```
352
+
Starting a Gradle Daemon (subsequent builds will be faster)
385
353
354
+
> Task :runFanOutFanInPattern
355
+
Durable Task worker is connecting to sidecar at localhost:8080.
356
+
Started new orchestration instance
357
+
Orchestration completed: [Name: 'FanOutFanIn_WordCount', ID: '<id-number>', RuntimeStatus: COMPLETED, CreatedAt: 2025-04-25T15:24:47.170Z, LastUpdatedAt: 2025-04-25T15:24:47.287Z, Input: '["Hello, world!","The quick brown fox jumps over t...', Output: '60']
358
+
Output: 60
386
359
```
387
360
388
361
::: zone-end
@@ -406,7 +379,19 @@ You can view the orchestration status and history via the [Durable Task Schedule
406
379
407
380
::: zone pivot="csharp"
408
381
409
-
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard.png" alt-text="Screenshot showing the orchestartion instance's details.":::
382
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-dotnet.png" alt-text="Screenshot showing the orchestartion instance's details for the .NET sample.":::
383
+
384
+
::: zone-end
385
+
386
+
::: zone pivot="python"
387
+
388
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-python.png" alt-text="Screenshot showing the orchestartion instance's details for the Python sample.":::
389
+
390
+
::: zone-end
391
+
392
+
::: zone pivot="java"
393
+
394
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-java.png" alt-text="Screenshot showing the orchestartion instance's details for the Java sample.":::
410
395
411
396
::: zone-end
412
397
@@ -603,9 +588,7 @@ result = client.wait_for_orchestration_completion(
603
588
604
589
:::zonepivot="java"
605
590
606
-
### Worker
607
-
608
-
Todemonstrate [thefan-out/fan-inpattern](../durable/durable-functions-overview.md#fan-in-out), theworkerprojectorchestrationcreatesparallelactivitytasksandwaitsfor all to complete. The orchestrator:
591
+
Todemonstrate [thefan-out/fan-inpattern](../durable/durable-functions-overview.md#fan-in-out), the `FanOutFanInPattern` projectorchestrationcreatesparallelactivitytasksandwaitsfor all to complete. The orchestrator:
609
592
610
593
1. Takes a list of work items as input.
611
594
1. Fans out by creating a separate task for each work item using ``.
@@ -614,42 +597,87 @@ To demonstrate [the fan-out/fan-in pattern](../durable/durable-functions-overvie
614
597
1. Fans in by aggregating all individual results using ``.
615
598
1. Returns the final aggregated result to the client.
616
599
617
-
Using fan-out/fan-in, the orchestration creates parallel activity tasks and waits for all to complete.
618
-
619
-
```java
620
-
621
-
```
600
+
The project contains:
622
601
623
-
#### Client
602
+
- **`DurableTaskSchedulerWorkerExtensions` worker**: Defines the orchestrator and activity functions.
603
+
- **`DurableTaskSchedulerClientExtension` client**: Sets up the worker host with proper connection string handling.
624
604
625
-
The worker uses `Microsoft.Extensions.Hosting` for proper lifecycle management.
605
+
### Worker
626
606
627
-
```csharp
628
-
using Microsoft.Extensions.Hosting;
629
-
//..
607
+
Using fan-out/fan-in, the orchestration creates parallel activity tasks and waits for all to complete.
0 commit comments