File tree Expand file tree Collapse file tree 3 files changed +26
-11
lines changed
Expand file tree Collapse file tree 3 files changed +26
-11
lines changed Original file line number Diff line number Diff line change 1212
1313 <ItemGroup >
1414 <!-- Using p2p references so we can show latest changes in samples. -->
15- <ProjectReference Include =" $(SrcRoot)Client/Grpc /Client.Grpc .csproj" />
16- <ProjectReference Include =" $(SrcRoot)Worker/Grpc /Worker.Grpc .csproj" />
15+ <ProjectReference Include =" $(SrcRoot)Client/AzureManaged /Client.AzureManaged .csproj" />
16+ <ProjectReference Include =" $(SrcRoot)Worker/AzureManaged /Worker.AzureManaged .csproj" />
1717
1818 <!-- Reference the source generator -->
1919 <ProjectReference Include =" $(SrcRoot)Generators/Generators.csproj"
Original file line number Diff line number Diff line change 66using EventsSample ;
77using Microsoft . DurableTask ;
88using Microsoft . DurableTask . Client ;
9+ using Microsoft . DurableTask . Client . AzureManaged ;
910using Microsoft . DurableTask . Worker ;
11+ using Microsoft . DurableTask . Worker . AzureManaged ;
12+ using Microsoft . Extensions . Configuration ;
1013using Microsoft . Extensions . DependencyInjection ;
1114using Microsoft . Extensions . Hosting ;
1215
1316HostApplicationBuilder builder = Host . CreateApplicationBuilder ( args ) ;
1417
15- builder . Services . AddDurableTaskClient ( ) . UseGrpc ( ) ;
16- builder . Services . AddDurableTaskWorker ( )
17- . AddTasks ( tasks =>
18+ string schedulerConnectionString = builder . Configuration . GetValue < string > ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" )
19+ ?? throw new InvalidOperationException ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING is not set." ) ;
20+
21+ builder . Services . AddDurableTaskClient ( clientBuilder => clientBuilder . UseDurableTaskScheduler ( schedulerConnectionString ) ) ;
22+
23+ builder . Services . AddDurableTaskWorker ( workerBuilder =>
24+ {
25+ workerBuilder . AddTasks ( tasks =>
1826 {
1927 tasks . AddOrchestrator < ApprovalOrchestrator > ( ) ;
2028 tasks . AddActivity < NotifyApprovalRequiredActivity > ( ) ;
2129 tasks . AddOrchestrator < DataProcessingOrchestrator > ( ) ;
2230 tasks . AddActivity < ProcessDataActivity > ( ) ;
23- } )
24- . UseGrpc ( ) ;
31+ } ) ;
32+
33+ workerBuilder . UseDurableTaskScheduler ( schedulerConnectionString ) ;
34+ } ) ;
2535
2636IHost host = builder . Build ( ) ;
2737await host . StartAsync ( ) ;
Original file line number Diff line number Diff line change @@ -63,11 +63,16 @@ await client.RaiseEventAsync(
6363
6464## Running the Sample
6565
66- 1 . Ensure you have the Durable Task sidecar running (if using gRPC mode)
66+ This sample is configured to use ** Durable Task Scheduler (DTS)** (no local gRPC sidecar required).
67+
68+ 1 . Set the DTS connection string:
69+ ``` bash
70+ export DURABLE_TASK_SCHEDULER_CONNECTION_STRING=" ..."
71+ ```
67722. Run the sample:
68- ``` bash
69- dotnet run
70- ```
73+ ` ` ` bash
74+ dotnet run
75+ ` ` `
7176
7277The sample will:
73781. Start an approval workflow and wait for an approval event
You can’t perform that action at this time.
0 commit comments