File tree Expand file tree Collapse file tree
ActivityHeartbeatingCancellation
OpenTelemetry/CoreSdkForwarding
UpdateWithStartEarlyReturn Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 </PropertyGroup >
2020
2121 <ItemGroup >
22- <PackageReference Include =" Temporalio" Version =" 1.9 .0" />
23- <PackageReference Include =" Temporalio.Extensions.DiagnosticSource" Version =" 1.9 .0" />
24- <PackageReference Include =" Temporalio.Extensions.Hosting" Version =" 1.9 .0" />
25- <PackageReference Include =" Temporalio.Extensions.OpenTelemetry" Version =" 1.9 .0" />
22+ <PackageReference Include =" Temporalio" Version =" 1.10 .0" />
23+ <PackageReference Include =" Temporalio.Extensions.DiagnosticSource" Version =" 1.10 .0" />
24+ <PackageReference Include =" Temporalio.Extensions.Hosting" Version =" 1.10 .0" />
25+ <PackageReference Include =" Temporalio.Extensions.OpenTelemetry" Version =" 1.10 .0" />
2626 <!--
2727 Can also reference the SDK downloaded to a local directory:
2828 <ProjectReference Include="$(MSBuildThisFileDirectory)..\temporal-sdk-dotnet\src\Temporalio\Temporalio.csproj" />
Original file line number Diff line number Diff line change 11using Microsoft . Extensions . Logging ;
22using Temporalio . Client ;
3- using Temporalio . Client . EnvConfig ;
3+ using Temporalio . Common . EnvConfig ;
44using Temporalio . Exceptions ;
55using Temporalio . Worker ;
66using TemporalioSamples . ActivityHeartbeatingCancellation ;
77
88// Create a client to localhost on default namespace
99var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
10- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
11- {
12- connectOptions . TargetHost = "localhost:7233" ;
13- }
10+ connectOptions . TargetHost ??= "localhost:7233" ;
1411connectOptions . LoggerFactory = LoggerFactory . Create ( builder =>
1512 builder .
1613 AddSimpleConsole ( options => options . TimestampFormat = "[HH:mm:ss] " ) .
Original file line number Diff line number Diff line change 11using Microsoft . Extensions . Logging ;
22using Temporalio . Client ;
3- using Temporalio . Client . EnvConfig ;
3+ using Temporalio . Common . EnvConfig ;
44using Temporalio . Worker ;
55using TemporalioSamples . ActivitySimple ;
66
77// Create a client to localhost on default namespace
88var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
9- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
10- {
11- connectOptions . TargetHost = "localhost:7233" ;
12- }
9+ connectOptions . TargetHost ??= "localhost:7233" ;
1310connectOptions . LoggerFactory = LoggerFactory . Create ( builder =>
1411 builder .
1512 AddSimpleConsole ( options => options . TimestampFormat = "[HH:mm:ss] " ) .
Original file line number Diff line number Diff line change 11using Temporalio . Activities ;
22using Temporalio . Client ;
3- using Temporalio . Client . EnvConfig ;
3+ using Temporalio . Common . EnvConfig ;
44using Temporalio . Worker ;
55using Temporalio . Workflows ;
66using TemporalioSamples . ActivityWorker ;
77
88// Create a client to localhost on default namespace
99var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
10- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
11- {
12- connectOptions . TargetHost = "localhost:7233" ;
13- }
10+ connectOptions . TargetHost ??= "localhost:7233" ;
1411var client = await TemporalClient . ConnectAsync ( connectOptions ) ;
1512
1613// Create worker
Original file line number Diff line number Diff line change 11using Temporalio . Client ;
2- using Temporalio . Client . EnvConfig ;
2+ using Temporalio . Common . EnvConfig ;
33using TemporalioSamples . AspNet . Worker ;
44
55var builder = WebApplication . CreateBuilder ( args ) ;
1515 // on separately (VSTHRD003). We may prefer a direct DI extension, see
1616 // https://github.com/temporalio/sdk-dotnet/issues/46.
1717 var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
18- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
19- {
20- connectOptions . TargetHost = "localhost:7233" ;
21- }
18+ connectOptions . TargetHost ??= "localhost:7233" ;
2219 connectOptions . LoggerFactory = ctx . GetRequiredService < ILoggerFactory > ( ) ;
2320 return TemporalClient . ConnectAsync ( connectOptions ) ;
2421} ) ;
Original file line number Diff line number Diff line change 33using Microsoft . Extensions . Hosting ;
44using Microsoft . Extensions . Logging ;
55using Temporalio . Client ;
6- using Temporalio . Client . EnvConfig ;
6+ using Temporalio . Common . EnvConfig ;
77using Temporalio . Extensions . Hosting ;
88using TemporalioSamples . Bedrock . Basic ;
99
@@ -51,10 +51,7 @@ async Task SendMessageAsync()
5151async Task < ITemporalClient > CreateClientAsync ( )
5252{
5353 var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
54- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
55- {
56- connectOptions . TargetHost = "localhost:7233" ;
57- }
54+ connectOptions . TargetHost ??= "localhost:7233" ;
5855 connectOptions . LoggerFactory = LoggerFactory . Create ( builder =>
5956 builder .
6057 AddSimpleConsole ( options => options . TimestampFormat = "[HH:mm:ss] " ) .
Original file line number Diff line number Diff line change 33using Microsoft . Extensions . Hosting ;
44using Microsoft . Extensions . Logging ;
55using Temporalio . Client ;
6- using Temporalio . Client . EnvConfig ;
6+ using Temporalio . Common . EnvConfig ;
77using Temporalio . Extensions . Hosting ;
88using TemporalioSamples . Bedrock . Entity ;
99
@@ -82,10 +82,7 @@ async Task EndChatAsync()
8282async Task < ITemporalClient > CreateClientAsync ( )
8383{
8484 var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
85- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
86- {
87- connectOptions . TargetHost = "localhost:7233" ;
88- }
85+ connectOptions . TargetHost ??= "localhost:7233" ;
8986 connectOptions . LoggerFactory = LoggerFactory . Create ( builder =>
9087 builder .
9188 AddSimpleConsole ( options => options . TimestampFormat = "[HH:mm:ss] " ) .
Original file line number Diff line number Diff line change 33using Microsoft . Extensions . Hosting ;
44using Microsoft . Extensions . Logging ;
55using Temporalio . Client ;
6- using Temporalio . Client . EnvConfig ;
6+ using Temporalio . Common . EnvConfig ;
77using Temporalio . Extensions . Hosting ;
88using TemporalioSamples . Bedrock . SignalsAndQueries ;
99
@@ -73,10 +73,7 @@ async Task GetHistoryAsync()
7373async Task < ITemporalClient > CreateClientAsync ( )
7474{
7575 var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
76- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
77- {
78- connectOptions . TargetHost = "localhost:7233" ;
79- }
76+ connectOptions . TargetHost ??= "localhost:7233" ;
8077 connectOptions . LoggerFactory = LoggerFactory . Create ( builder =>
8178 builder .
8279 AddSimpleConsole ( options => options . TimestampFormat = "[HH:mm:ss] " ) .
Original file line number Diff line number Diff line change 11using Microsoft . Extensions . Logging ;
22using Temporalio . Client ;
3- using Temporalio . Client . EnvConfig ;
3+ using Temporalio . Common . EnvConfig ;
44using Temporalio . Converters ;
55using Temporalio . Worker ;
66using TemporalioSamples . ContextPropagation ;
1313
1414// Create a client to localhost on default namespace
1515var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
16- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
17- {
18- connectOptions . TargetHost = "localhost:7233" ;
19- }
16+ connectOptions . TargetHost ??= "localhost:7233" ;
2017connectOptions . LoggerFactory = loggerFactory ;
2118// This is where we set the interceptor to propagate context
2219connectOptions . Interceptors = new [ ]
Original file line number Diff line number Diff line change 11namespace TemporalioSamples . CounterInterceptor ;
22
33using Temporalio . Client ;
4- using Temporalio . Client . EnvConfig ;
4+ using Temporalio . Common . EnvConfig ;
55using Temporalio . Worker ;
66
77internal class Program
@@ -10,10 +10,7 @@ private static async Task Main(string[] args)
1010 {
1111 var counterInterceptor = new MyCounterInterceptor ( ) ;
1212 var connectOptions = ClientEnvConfig . LoadClientConnectOptions ( ) ;
13- if ( string . IsNullOrEmpty ( connectOptions . TargetHost ) )
14- {
15- connectOptions . TargetHost = "localhost:7233" ;
16- }
13+ connectOptions . TargetHost ??= "localhost:7233" ;
1714 connectOptions . Interceptors = new [ ]
1815 {
1916 counterInterceptor ,
You can’t perform that action at this time.
0 commit comments