Skip to content

Commit 9ac9d69

Browse files
authored
Increase visibility on some client constructs and minor docs updates (#434)
Fixes #218 Fixes #228 Fixes #419
1 parent 5cb605e commit 9ac9d69

8 files changed

+44
-22
lines changed

src/Temporalio/Client/ITemporalClient.Workflow.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ Task<WorkflowUpdateHandle<TUpdateResult>> StartUpdateWithStartWorkflowAsync<TUpd
177177
/// <param name="query">Query to use for filtering.</param>
178178
/// <param name="options">Options for the list call.</param>
179179
/// <returns>Async enumerator for the workflows.</returns>
180+
/// <seealso href="https://docs.temporal.io/visibility">Visibility docs.</seealso>
180181
public IAsyncEnumerable<WorkflowExecution> ListWorkflowsAsync(
181182
string query, WorkflowListOptions? options = null);
182183
#endif
@@ -187,6 +188,7 @@ public IAsyncEnumerable<WorkflowExecution> ListWorkflowsAsync(
187188
/// <param name="query">Query to use for counting.</param>
188189
/// <param name="options">Options for the count call.</param>
189190
/// <returns>Count information for the workflows.</returns>
191+
/// <seealso href="https://docs.temporal.io/visibility">Visibility docs.</seealso>
190192
public Task<WorkflowExecutionCount> CountWorkflowsAsync(
191193
string query, WorkflowCountOptions? options = null);
192194
}

src/Temporalio/Client/Schedules/ScheduleDescription.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ public class ScheduleDescription
1717
private readonly Lazy<IReadOnlyDictionary<string, IEncodedRawValue>> memo;
1818
private readonly Lazy<SearchAttributeCollection> searchAttributes;
1919

20-
private ScheduleDescription(
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="ScheduleDescription"/> class.
22+
/// </summary>
23+
/// <param name="id">ID for the schedule.</param>
24+
/// <param name="schedule">Schedule.</param>
25+
/// <param name="rawDescription">Raw protobuf description.</param>
26+
/// <param name="dataConverter">Data converter.</param>
27+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
28+
protected internal ScheduleDescription(
2129
string id, Schedule schedule, DescribeScheduleResponse rawDescription, DataConverter dataConverter)
2230
{
2331
Id = id;

src/Temporalio/Client/Schedules/ScheduleHandle.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public record ScheduleHandle(
2020
/// <param name="backfills">Backfill periods.</param>
2121
/// <param name="rpcOptions">RPC options.</param>
2222
/// <returns>Task for completion.</returns>
23-
public Task BackfillAsync(
23+
public virtual Task BackfillAsync(
2424
IReadOnlyCollection<ScheduleBackfill> backfills, RpcOptions? rpcOptions = null)
2525
{
2626
if (backfills.Count == 0)
@@ -36,15 +36,15 @@ public Task BackfillAsync(
3636
/// </summary>
3737
/// <param name="rpcOptions">RPC options.</param>
3838
/// <returns>Task for completion.</returns>
39-
public Task DeleteAsync(RpcOptions? rpcOptions = null) =>
39+
public virtual Task DeleteAsync(RpcOptions? rpcOptions = null) =>
4040
Client.OutboundInterceptor.DeleteScheduleAsync(new(Id: Id, RpcOptions: rpcOptions));
4141

4242
/// <summary>
4343
/// Fetch this schedule's description.
4444
/// </summary>
4545
/// <param name="rpcOptions">RPC options.</param>
4646
/// <returns>Schedule description.</returns>
47-
public Task<ScheduleDescription> DescribeAsync(RpcOptions? rpcOptions = null) =>
47+
public virtual Task<ScheduleDescription> DescribeAsync(RpcOptions? rpcOptions = null) =>
4848
Client.OutboundInterceptor.DescribeScheduleAsync(new(Id: Id, RpcOptions: rpcOptions));
4949

5050
/// <summary>
@@ -53,7 +53,7 @@ public Task<ScheduleDescription> DescribeAsync(RpcOptions? rpcOptions = null) =>
5353
/// <param name="note">Note to set when pausing.</param>
5454
/// <param name="rpcOptions">RPC options.</param>
5555
/// <returns>Task for completion.</returns>
56-
public Task PauseAsync(string? note = null, RpcOptions? rpcOptions = null) =>
56+
public virtual Task PauseAsync(string? note = null, RpcOptions? rpcOptions = null) =>
5757
Client.OutboundInterceptor.PauseScheduleAsync(
5858
new(Id: Id, Note: note, RpcOptions: rpcOptions));
5959

@@ -62,7 +62,7 @@ public Task PauseAsync(string? note = null, RpcOptions? rpcOptions = null) =>
6262
/// </summary>
6363
/// <param name="options">Options for triggering.</param>
6464
/// <returns>Task for completion.</returns>
65-
public Task TriggerAsync(ScheduleTriggerOptions? options = null) =>
65+
public virtual Task TriggerAsync(ScheduleTriggerOptions? options = null) =>
6666
Client.OutboundInterceptor.TriggerScheduleAsync(new(Id: Id, Options: options));
6767

6868
/// <summary>
@@ -71,7 +71,7 @@ public Task TriggerAsync(ScheduleTriggerOptions? options = null) =>
7171
/// <param name="note">Note to set when unpausing.</param>
7272
/// <param name="rpcOptions">RPC options.</param>
7373
/// <returns>Task for completion.</returns>
74-
public Task UnpauseAsync(string? note = null, RpcOptions? rpcOptions = null) =>
74+
public virtual Task UnpauseAsync(string? note = null, RpcOptions? rpcOptions = null) =>
7575
Client.OutboundInterceptor.UnpauseScheduleAsync(
7676
new(Id: Id, Note: note, RpcOptions: rpcOptions));
7777

@@ -98,7 +98,7 @@ public Task UpdateAsync(
9898
/// to perform an update.</param>
9999
/// <param name="rpcOptions">RPC options.</param>
100100
/// <returns>Task for completion.</returns>
101-
public Task UpdateAsync(
101+
public virtual Task UpdateAsync(
102102
Func<ScheduleUpdateInput, Task<ScheduleUpdate?>> updater,
103103
RpcOptions? rpcOptions = null) =>
104104
Client.OutboundInterceptor.UpdateScheduleAsync(

src/Temporalio/Client/Schedules/ScheduleListDescription.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public class ScheduleListDescription
2020
/// </summary>
2121
/// <param name="rawEntry">Raw proto.</param>
2222
/// <param name="dataConverter">Data converter.</param>
23-
internal ScheduleListDescription(
23+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
24+
protected internal ScheduleListDescription(
2425
Api.Schedule.V1.ScheduleListEntry rawEntry, DataConverter dataConverter)
2526
{
2627
RawEntry = rawEntry;

src/Temporalio/Client/WorkflowExecution.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public class WorkflowExecution
2222
/// </summary>
2323
/// <param name="rawInfo">Raw proto info.</param>
2424
/// <param name="dataConverter">Data converter used for memos.</param>
25-
internal WorkflowExecution(WorkflowExecutionInfo rawInfo, DataConverter dataConverter)
25+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
26+
protected internal WorkflowExecution(WorkflowExecutionInfo rawInfo, DataConverter dataConverter)
2627
{
2728
RawInfo = rawInfo;
2829
// Search attribute conversion is cheap so it doesn't need to lock on publication. But

src/Temporalio/Client/WorkflowExecutionCount.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public class WorkflowExecutionCount
1515
/// Initializes a new instance of the <see cref="WorkflowExecutionCount" /> class.
1616
/// </summary>
1717
/// <param name="raw">Raw proto.</param>
18-
internal WorkflowExecutionCount(CountWorkflowExecutionsResponse raw)
18+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
19+
protected internal WorkflowExecutionCount(CountWorkflowExecutionsResponse raw)
1920
{
2021
Count = raw.Count;
2122
Groups = raw.Groups?.Select(
@@ -42,7 +43,8 @@ public class AggregationGroup
4243
/// Initializes a new instance of the <see cref="AggregationGroup"/> class.
4344
/// </summary>
4445
/// <param name="raw">Raw proto.</param>
45-
internal AggregationGroup(CountWorkflowExecutionsResponse.Types.AggregationGroup raw)
46+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
47+
protected internal AggregationGroup(CountWorkflowExecutionsResponse.Types.AggregationGroup raw)
4648
{
4749
Count = raw.Count;
4850
GroupValues = raw.GroupValues?.

src/Temporalio/Client/WorkflowExecutionDescription.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ namespace Temporalio.Client
99
/// </summary>
1010
public class WorkflowExecutionDescription : WorkflowExecution
1111
{
12-
private WorkflowExecutionDescription(
12+
/// <summary>
13+
/// Initializes a new instance of the <see cref="WorkflowExecutionDescription"/> class.
14+
/// </summary>
15+
/// <param name="rawDescription">Raw protobuf description.</param>
16+
/// <param name="staticSummary">Static summary.</param>
17+
/// <param name="staticDetails">Static details.</param>
18+
/// <param name="dataConverter">Data converter.</param>
19+
/// <remarks>WARNING: This constructor may be mutated in backwards incompatible ways.</remarks>
20+
protected internal WorkflowExecutionDescription(
1321
DescribeWorkflowExecutionResponse rawDescription,
1422
string? staticSummary,
1523
string? staticDetails,

src/Temporalio/Client/WorkflowHandle.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public Task SignalAsync<TWorkflow>(
228228
/// the workflow yet.
229229
/// </returns>
230230
/// <exception cref="RpcException">Server-side error.</exception>
231-
public Task SignalAsync(
231+
public virtual Task SignalAsync(
232232
string signal, IReadOnlyCollection<object?> args, WorkflowSignalOptions? options = null) =>
233233
Client.OutboundInterceptor.SignalWorkflowAsync(new(
234234
Id: Id,
@@ -292,7 +292,7 @@ public Task<TQueryResult> QueryAsync<TWorkflow, TQueryResult>(
292292
/// Query rejected by server based on rejection condition.
293293
/// </exception>
294294
/// <exception cref="RpcException">Server-side error.</exception>
295-
public Task<TQueryResult> QueryAsync<TQueryResult>(
295+
public virtual Task<TQueryResult> QueryAsync<TQueryResult>(
296296
string query, IReadOnlyCollection<object?> args, WorkflowQueryOptions? options = null) =>
297297
Client.OutboundInterceptor.QueryWorkflowAsync<TQueryResult>(new(
298298
Id: Id,
@@ -357,7 +357,7 @@ public async Task<WorkflowUpdateHandle> StartUpdateAsync(
357357
/// <param name="args">Arguments for the update.</param>
358358
/// <param name="options">Update options. Currently <c>WaitForStage</c> is required.</param>
359359
/// <returns>Workflow update handle.</returns>
360-
public Task<WorkflowUpdateHandle<TUpdateResult>> StartUpdateAsync<TUpdateResult>(
360+
public virtual Task<WorkflowUpdateHandle<TUpdateResult>> StartUpdateAsync<TUpdateResult>(
361361
string update, IReadOnlyCollection<object?> args, WorkflowUpdateStartOptions options) =>
362362
Client.OutboundInterceptor.StartWorkflowUpdateAsync<TUpdateResult>(new(
363363
Id: Id,
@@ -471,7 +471,7 @@ public WorkflowUpdateHandle<TUpdateResult> GetUpdateHandle<TUpdateResult>(string
471471
/// </summary>
472472
/// <param name="options">Extra options.</param>
473473
/// <returns>Description for the workflow.</returns>
474-
public Task<WorkflowExecutionDescription> DescribeAsync(
474+
public virtual Task<WorkflowExecutionDescription> DescribeAsync(
475475
WorkflowDescribeOptions? options = null) =>
476476
Client.OutboundInterceptor.DescribeWorkflowAsync(new(
477477
Id: Id,
@@ -484,7 +484,7 @@ public Task<WorkflowExecutionDescription> DescribeAsync(
484484
/// <param name="options">Cancellation options.</param>
485485
/// <returns>Cancel accepted task.</returns>
486486
/// <exception cref="RpcException">Server-side error.</exception>
487-
public Task CancelAsync(WorkflowCancelOptions? options = null) =>
487+
public virtual Task CancelAsync(WorkflowCancelOptions? options = null) =>
488488
Client.OutboundInterceptor.CancelWorkflowAsync(new(
489489
Id: Id,
490490
RunId: RunId,
@@ -498,7 +498,7 @@ public Task CancelAsync(WorkflowCancelOptions? options = null) =>
498498
/// <param name="options">Termination options.</param>
499499
/// <returns>Terminate completed task.</returns>
500500
/// <exception cref="RpcException">Server-side error.</exception>
501-
public Task TerminateAsync(
501+
public virtual Task TerminateAsync(
502502
string? reason = null, WorkflowTerminateOptions? options = null) =>
503503
Client.OutboundInterceptor.TerminateWorkflowAsync(new(
504504
Id: Id,
@@ -509,11 +509,11 @@ public Task TerminateAsync(
509509

510510
#if NETCOREAPP3_0_OR_GREATER
511511
/// <summary>
512-
/// Fetcgh history for the workflow.
512+
/// Fetch history for the workflow.
513513
/// </summary>
514514
/// <param name="options">Options for history fetching.</param>
515515
/// <returns>Fetched history.</returns>
516-
public async Task<WorkflowHistory> FetchHistoryAsync(
516+
public async virtual Task<WorkflowHistory> FetchHistoryAsync(
517517
WorkflowHistoryEventFetchOptions? options = null)
518518
{
519519
WorkflowHistoryEventFetchOptions? eventFetchOptions = null;
@@ -539,7 +539,7 @@ public async Task<WorkflowHistory> FetchHistoryAsync(
539539
/// </summary>
540540
/// <param name="options">History event fetch options.</param>
541541
/// <returns>Async enumerable to iterate events for.</returns>
542-
public IAsyncEnumerable<HistoryEvent> FetchHistoryEventsAsync(
542+
public virtual IAsyncEnumerable<HistoryEvent> FetchHistoryEventsAsync(
543543
WorkflowHistoryEventFetchOptions? options = null) =>
544544
FetchHistoryEventsInternalAsync(options);
545545

0 commit comments

Comments
 (0)