Skip to content

Commit 65dfb85

Browse files
committed
doc
1 parent 3a6dc52 commit 65dfb85

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

src/Extensions/Azure/DurableTaskSchedulerExtensions.cs

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@
88

99
namespace Microsoft.DurableTask.Extensions.Azure;
1010

11+
/// <summary>
12+
/// Extension methods for configuring Durable Task workers and clients to use the Azure Durable Task Scheduler service.
13+
/// </summary>
1114
public static class DurableTaskSchedulerExtensions
1215
{
13-
// Configure the Durable Task *Worker* to use the Durable Task Scheduler service with the specified options.
16+
/// <summary>
17+
/// Configures Durable Task worker to use the Azure Durable Task Scheduler service.
18+
/// </summary>
19+
/// <param name="builder">The worker builder to configure.</param>
20+
/// <param name="endpointAddress">The endpoint address of the Durable Task Scheduler service.</param>
21+
/// <param name="taskHubName">The name of the task hub to connect to.</param>
22+
/// <param name="credential">The credential to use for authentication.</param>
23+
/// <param name="configure">Optional callback to configure additional options.</param>
1424
public static void UseDurableTaskScheduler(
1525
this IDurableTaskWorkerBuilder builder,
1626
string endpointAddress,
@@ -19,10 +29,18 @@ public static void UseDurableTaskScheduler(
1929
Action<DurableTaskSchedulerOptions>? configure = null)
2030
{
2131
DurableTaskSchedulerOptions options = new(endpointAddress, taskHubName, credential);
32+
2233
configure?.Invoke(options);
34+
2335
builder.UseGrpc(GetGrpcChannelForOptions(options));
2436
}
2537

38+
/// <summary>
39+
/// Configures Durable Task worker to use the Azure Durable Task Scheduler service using a connection string.
40+
/// </summary>
41+
/// <param name="builder">The worker builder to configure.</param>
42+
/// <param name="connectionString">The connection string for the Durable Task Scheduler service.</param>
43+
/// <param name="configure">Optional callback to configure additional options.</param>
2644
public static void UseDurableTaskScheduler(
2745
this IDurableTaskWorkerBuilder builder,
2846
string connectionString,
@@ -33,7 +51,14 @@ public static void UseDurableTaskScheduler(
3351
builder.UseGrpc(GetGrpcChannelForOptions(options));
3452
}
3553

36-
// Configure the Durable Task *Client* to use the Durable Task Scheduler service with the specified options.
54+
/// <summary>
55+
/// Configures Durable Task client to use the Azure Durable Task Scheduler service.
56+
/// </summary>
57+
/// <param name="builder">The client builder to configure.</param>
58+
/// <param name="endpointAddress">The endpoint address of the Durable Task Scheduler service.</param>
59+
/// <param name="taskHubName">The name of the task hub to connect to.</param>
60+
/// <param name="credential">The credential to use for authentication.</param>
61+
/// <param name="configure">Optional callback to configure additional options.</param>
3762
public static void UseDurableTaskScheduler(
3863
this IDurableTaskClientBuilder builder,
3964
string endpointAddress,
@@ -42,10 +67,18 @@ public static void UseDurableTaskScheduler(
4267
Action<DurableTaskSchedulerOptions>? configure = null)
4368
{
4469
DurableTaskSchedulerOptions options = new(endpointAddress, taskHubName, credential);
70+
4571
configure?.Invoke(options);
72+
4673
builder.UseGrpc(GetGrpcChannelForOptions(options));
4774
}
4875

76+
/// <summary>
77+
/// Configures Durable Task client to use the Azure Durable Task Scheduler service using a connection string.
78+
/// </summary>
79+
/// <param name="builder">The client builder to configure.</param>
80+
/// <param name="connectionString">The connection string for the Durable Task Scheduler service.</param>
81+
/// <param name="configure">Optional callback to configure additional options.</param>
4982
public static void UseDurableTaskScheduler(
5083
this IDurableTaskClientBuilder builder,
5184
string connectionString,

src/Extensions/Azure/DurableTaskSchedulerOptions.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
namespace Microsoft.DurableTask.Extensions.Azure;
1010

11-
// NOTE: These options definitions will eventually be provided by the Durable Task SDK itself.
12-
1311
/// <summary>
1412
/// Options for configuring the Durable Task Scheduler.
1513
/// </summary>
@@ -50,12 +48,23 @@ internal DurableTaskSchedulerOptions(string endpointAddress, string taskHubName,
5048
/// </summary>
5149
public string? WorkerId { get; set; }
5250

53-
51+
/// <summary>
52+
/// Creates a new instance of <see cref="DurableTaskSchedulerOptions"/> from a connection string.
53+
/// </summary>
54+
/// <param name="connectionString">The connection string containing the configuration settings.</param>
55+
/// <returns>A new instance of <see cref="DurableTaskSchedulerOptions"/> configured with the connection string settings.</returns>
56+
/// <exception cref="ArgumentException">Thrown when the connection string contains an unsupported authentication type.</exception>
5457
public static DurableTaskSchedulerOptions FromConnectionString(string connectionString)
5558
{
5659
return FromConnectionString(new DurableTaskSchedulerConnectionString(connectionString));
5760
}
5861

62+
/// <summary>
63+
/// Creates a new instance of <see cref="DurableTaskSchedulerOptions"/> from a parsed connection string.
64+
/// </summary>
65+
/// <param name="connectionString">The parsed connection string containing the configuration settings.</param>
66+
/// <returns>A new instance of <see cref="DurableTaskSchedulerOptions"/> configured with the connection string settings.</returns>
67+
/// <exception cref="ArgumentException">Thrown when the connection string contains an unsupported authentication type.</exception>
5968
public static DurableTaskSchedulerOptions FromConnectionString(
6069
DurableTaskSchedulerConnectionString connectionString)
6170
{

0 commit comments

Comments
 (0)