@@ -73,7 +73,7 @@ public virtual Task<string> ScheduleNewOrchestrationInstanceAsync(
73
73
/// and health of the backend task hub, and whether a start time was provided via <paramref name="options" />.
74
74
/// </para><para>
75
75
/// The task associated with this method completes after the orchestration instance was successfully scheduled. You
76
- /// can use the <see cref="GetInstanceMetadataAsync (string, bool, CancellationToken)"/> to query the status of the
76
+ /// can use the <see cref="GetInstancesAsync (string, bool, CancellationToken)"/> to query the status of the
77
77
/// scheduled instance, the <see cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/> method to wait
78
78
/// for the instance to transition out of the <see cref="OrchestrationRuntimeStatus.Pending"/> status, or the
79
79
/// <see cref="WaitForInstanceCompletionAsync(string, bool, CancellationToken)"/> method to wait for the instance to
@@ -140,10 +140,67 @@ public virtual Task RaiseEventAsync(
140
140
public abstract Task RaiseEventAsync (
141
141
string instanceId , string eventName , object ? eventPayload = null , CancellationToken cancellation = default ) ;
142
142
143
- /// <inheritdoc cref="TerminateAsync(string, object, CancellationToken)"/>
144
- public virtual Task TerminateAsync (
143
+ /// <inheritdoc cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/>
144
+ public virtual Task < OrchestrationMetadata > WaitForInstanceStartAsync (
145
+ string instanceId , CancellationToken cancellation )
146
+ => this . WaitForInstanceStartAsync ( instanceId , false , cancellation ) ;
147
+
148
+ /// <summary>
149
+ /// Waits for an orchestration to start running and returns a <see cref="OrchestrationMetadata"/>
150
+ /// object that contains metadata about the started instance.
151
+ /// </summary>
152
+ /// <remarks>
153
+ /// <para>
154
+ /// A "started" orchestration instance is any instance not in the <see cref="OrchestrationRuntimeStatus.Pending"/>
155
+ /// state.
156
+ /// </para><para>
157
+ /// If an orchestration instance is already running when this method is called, the method will return immediately.
158
+ /// </para>
159
+ /// </remarks>
160
+ /// <param name="instanceId">The unique ID of the orchestration instance to wait for.</param>
161
+ /// <param name="getInputsAndOutputs">
162
+ /// Specify <c>true</c> to fetch the orchestration instance's inputs, outputs, and custom status, or <c>false</c> to
163
+ /// omit them. The default value is <c>false</c> to minimize the network bandwidth, serialization, and memory costs
164
+ /// associated with fetching the instance metadata.
165
+ /// </param>
166
+ /// <param name="cancellation">A <see cref="CancellationToken"/> that can be used to cancel the wait operation.</param>
167
+ /// <returns>
168
+ /// Returns a <see cref="OrchestrationMetadata"/> record that describes the orchestration instance and its execution
169
+ /// status or <c>null</c> if no instance with ID <paramref name="instanceId"/> is found.
170
+ /// </returns>
171
+ public abstract Task < OrchestrationMetadata > WaitForInstanceStartAsync (
172
+ string instanceId , bool getInputsAndOutputs = false , CancellationToken cancellation = default ) ;
173
+
174
+ /// <inheritdoc cref="WaitForInstanceCompletionAsync(string, bool, CancellationToken)"/>
175
+ public virtual Task < OrchestrationMetadata > WaitForInstanceCompletionAsync (
145
176
string instanceId , CancellationToken cancellation )
146
- => this . TerminateAsync ( instanceId , null , cancellation ) ;
177
+ => this . WaitForInstanceCompletionAsync ( instanceId , false , cancellation ) ;
178
+
179
+ /// <summary>
180
+ /// Waits for an orchestration to complete and returns a <see cref="OrchestrationMetadata"/>
181
+ /// object that contains metadata about the started instance.
182
+ /// </summary>
183
+ /// <remarks>
184
+ /// <para>
185
+ /// A "completed" orchestration instance is any instance in one of the terminal states. For example, the
186
+ /// <see cref="OrchestrationRuntimeStatus.Completed"/>, <see cref="OrchestrationRuntimeStatus.Failed"/>, or
187
+ /// <see cref="OrchestrationRuntimeStatus.Terminated"/> states.
188
+ /// </para><para>
189
+ /// Orchestrations are long-running and could take hours, days, or months before completing.
190
+ /// Orchestrations can also be eternal, in which case they'll never complete unless terminated.
191
+ /// In such cases, this call may block indefinitely, so care must be taken to ensure appropriate timeouts are
192
+ /// enforced using the <paramref name="cancellation"/> parameter.
193
+ /// </para><para>
194
+ /// If an orchestration instance is already complete when this method is called, the method will return immediately.
195
+ /// </para>
196
+ /// </remarks>
197
+ /// <inheritdoc cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/>
198
+ public abstract Task < OrchestrationMetadata > WaitForInstanceCompletionAsync (
199
+ string instanceId , bool getInputsAndOutputs = false , CancellationToken cancellation = default ) ;
200
+
201
+ /// <inheritdoc cref="TerminateInstanceAsync(string, object, CancellationToken)"/>
202
+ public virtual Task TerminateInstanceAsync ( string instanceId , CancellationToken cancellation )
203
+ => this . TerminateInstanceAsync ( instanceId , null , cancellation ) ;
147
204
148
205
/// <summary>
149
206
/// Terminates a running orchestration instance and updates its runtime status to
@@ -175,17 +232,16 @@ public virtual Task TerminateAsync(
175
232
/// termination of the orchestration once enqueued.
176
233
/// </param>
177
234
/// <returns>A task that completes when the terminate message is enqueued.</returns>
178
- public abstract Task TerminateAsync (
235
+ public abstract Task TerminateInstanceAsync (
179
236
string instanceId , object ? output = null , CancellationToken cancellation = default ) ;
180
237
181
- /// <inheritdoc cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/>
182
- public virtual Task < OrchestrationMetadata > WaitForInstanceStartAsync (
183
- string instanceId , CancellationToken cancellation )
184
- => this . WaitForInstanceStartAsync ( instanceId , false , cancellation ) ;
238
+ /// <inheritdoc cref="SuspendInstanceAsync(string, string, CancellationToken)"/>
239
+ public virtual Task SuspendInstanceAsync ( string instanceId , CancellationToken cancellation )
240
+ => this . SuspendInstanceAsync ( instanceId , null , cancellation ) ;
185
241
186
242
/// <summary>
187
- /// Suspends an orchestration instance, halting processing of it until <see cref="ResumeInstanceAsync" /> is used
188
- /// to resume the orchestration.
243
+ /// Suspends an orchestration instance, halting processing of it until
244
+ /// <see cref="ResumeInstanceAsync(string, string, CancellationToken)" /> is used to resume the orchestration.
189
245
/// </summary>
190
246
/// <param name="instanceId">The instance ID of the orchestration to suspend.</param>
191
247
/// <param name="reason">The optional suspension reason.</param>
@@ -197,8 +253,12 @@ public virtual Task<OrchestrationMetadata> WaitForInstanceStartAsync(
197
253
public abstract Task SuspendInstanceAsync (
198
254
string instanceId , string ? reason = null , CancellationToken cancellation = default ) ;
199
255
256
+ /// <inheritdoc cref="ResumeInstanceAsync(string, string, CancellationToken)"/>
257
+ public virtual Task ResumeInstanceAsync ( string instanceId , CancellationToken cancellation )
258
+ => this . ResumeInstanceAsync ( instanceId , null , cancellation ) ;
259
+
200
260
/// <summary>
201
- /// Resumes an orchestration instance that was suspended via <see cref="SuspendInstanceAsync" />.
261
+ /// Resumes an orchestration instance that was suspended via <see cref="SuspendInstanceAsync(string, string, CancellationToken) " />.
202
262
/// </summary>
203
263
/// <param name="instanceId">The instance ID of the orchestration to resume.</param>
204
264
/// <param name="reason">The optional resume reason.</param>
@@ -210,63 +270,10 @@ public abstract Task SuspendInstanceAsync(
210
270
public abstract Task ResumeInstanceAsync (
211
271
string instanceId , string ? reason = null , CancellationToken cancellation = default ) ;
212
272
213
- /// <summary>
214
- /// Waits for an orchestration to start running and returns a <see cref="OrchestrationMetadata"/>
215
- /// object that contains metadata about the started instance.
216
- /// </summary>
217
- /// <remarks>
218
- /// <para>
219
- /// A "started" orchestration instance is any instance not in the <see cref="OrchestrationRuntimeStatus.Pending"/>
220
- /// state.
221
- /// </para><para>
222
- /// If an orchestration instance is already running when this method is called, the method will return immediately.
223
- /// </para>
224
- /// </remarks>
225
- /// <param name="instanceId">The unique ID of the orchestration instance to wait for.</param>
226
- /// <param name="getInputsAndOutputs">
227
- /// Specify <c>true</c> to fetch the orchestration instance's inputs, outputs, and custom status, or <c>false</c> to
228
- /// omit them. The default value is <c>false</c> to minimize the network bandwidth, serialization, and memory costs
229
- /// associated with fetching the instance metadata.
230
- /// </param>
231
- /// <param name="cancellation">A <see cref="CancellationToken"/> that can be used to cancel the wait operation.</param>
232
- /// <returns>
233
- /// Returns a <see cref="OrchestrationMetadata"/> record that describes the orchestration instance and its execution
234
- /// status or <c>null</c> if no instance with ID <paramref name="instanceId"/> is found.
235
- /// </returns>
236
- public abstract Task < OrchestrationMetadata > WaitForInstanceStartAsync (
237
- string instanceId , bool getInputsAndOutputs = false , CancellationToken cancellation = default ) ;
238
-
239
- /// <inheritdoc cref="WaitForInstanceCompletionAsync(string, bool, CancellationToken)"/>
240
- public virtual Task < OrchestrationMetadata > WaitForInstanceCompletionAsync (
241
- string instanceId , CancellationToken cancellation )
242
- => this . WaitForInstanceCompletionAsync ( instanceId , false , cancellation ) ;
243
-
244
- /// <summary>
245
- /// Waits for an orchestration to complete and returns a <see cref="OrchestrationMetadata"/>
246
- /// object that contains metadata about the started instance.
247
- /// </summary>
248
- /// <remarks>
249
- /// <para>
250
- /// A "completed" orchestration instance is any instance in one of the terminal states. For example, the
251
- /// <see cref="OrchestrationRuntimeStatus.Completed"/>, <see cref="OrchestrationRuntimeStatus.Failed"/>, or
252
- /// <see cref="OrchestrationRuntimeStatus.Terminated"/> states.
253
- /// </para><para>
254
- /// Orchestrations are long-running and could take hours, days, or months before completing.
255
- /// Orchestrations can also be eternal, in which case they'll never complete unless terminated.
256
- /// In such cases, this call may block indefinitely, so care must be taken to ensure appropriate timeouts are
257
- /// enforced using the <paramref name="cancellation"/> parameter.
258
- /// </para><para>
259
- /// If an orchestration instance is already complete when this method is called, the method will return immediately.
260
- /// </para>
261
- /// </remarks>
262
- /// <inheritdoc cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/>
263
- public abstract Task < OrchestrationMetadata > WaitForInstanceCompletionAsync (
264
- string instanceId , bool getInputsAndOutputs = false , CancellationToken cancellation = default ) ;
265
-
266
- /// <inheritdoc cref="GetInstanceMetadataAsync(string, bool, CancellationToken)"/>
267
- public virtual Task < OrchestrationMetadata ? > GetInstanceMetadataAsync (
273
+ /// <inheritdoc cref="GetInstancesAsync(string, bool, CancellationToken)"/>
274
+ public virtual Task < OrchestrationMetadata ? > GetInstancesAsync (
268
275
string instanceId , CancellationToken cancellation )
269
- => this . GetInstanceMetadataAsync ( instanceId , false , cancellation ) ;
276
+ => this . GetInstancesAsync ( instanceId , false , cancellation ) ;
270
277
271
278
/// <summary>
272
279
/// Fetches orchestration instance metadata from the configured durable store.
@@ -278,15 +285,15 @@ public abstract Task<OrchestrationMetadata> WaitForInstanceCompletionAsync(
278
285
/// memory costs associated with fetching the instance metadata.
279
286
/// </remarks>
280
287
/// <inheritdoc cref="WaitForInstanceStartAsync(string, bool, CancellationToken)"/>
281
- public abstract Task < OrchestrationMetadata ? > GetInstanceMetadataAsync (
288
+ public abstract Task < OrchestrationMetadata ? > GetInstancesAsync (
282
289
string instanceId , bool getInputsAndOutputs = false , CancellationToken cancellation = default ) ;
283
290
284
291
/// <summary>
285
292
/// Queries orchestration instances.
286
293
/// </summary>
287
- /// <param name="query ">Filters down the instances included in the query.</param>
294
+ /// <param name="filter ">Filters down the instances included in the query.</param>
288
295
/// <returns>An async pageable of the query results.</returns>
289
- public abstract AsyncPageable < OrchestrationMetadata > GetInstances ( OrchestrationQuery ? query = null ) ;
296
+ public abstract AsyncPageable < OrchestrationMetadata > GetAllInstancesAsync ( OrchestrationQuery ? filter = null ) ;
290
297
291
298
/// <summary>
292
299
/// Purges orchestration instance metadata from the durable store.
@@ -314,7 +321,7 @@ public abstract Task<OrchestrationMetadata> WaitForInstanceCompletionAsync(
314
321
/// <see cref="PurgeResult.PurgedInstanceCount"/> value of <c>1</c> or <c>0</c>, depending on whether the target
315
322
/// instance was successfully purged.
316
323
/// </returns>
317
- public abstract Task < PurgeResult > PurgeInstanceMetadataAsync (
324
+ public abstract Task < PurgeResult > PurgeInstanceAsync (
318
325
string instanceId , CancellationToken cancellation = default ) ;
319
326
320
327
/// <summary>
@@ -328,7 +335,7 @@ public abstract Task<PurgeResult> PurgeInstanceMetadataAsync(
328
335
/// This method returns a <see cref="PurgeResult"/> object after the operation has completed with a
329
336
/// <see cref="PurgeResult.PurgedInstanceCount"/> indicating the number of orchestration instances that were purged.
330
337
/// </returns>
331
- public abstract Task < PurgeResult > PurgeInstancesAsync (
338
+ public abstract Task < PurgeResult > PurgeAllInstancesAsync (
332
339
PurgeInstancesFilter filter , CancellationToken cancellation = default ) ;
333
340
334
341
// TODO: Create task hub
0 commit comments