Skip to content

Commit 9164b37

Browse files
github-actions[bot]mitchdennydanmoseleyJamesNKeerhardt
authored
[release/9.1] Improve XML documentation comments (#7737)
* Improved XML doc comments. * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: Dan Moseley <[email protected]> * Update src/Aspire.Hosting/ResourceBuilderExtensions.cs Co-authored-by: James Newton-King <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: James Newton-King <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: James Newton-King <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: James Newton-King <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: Eric Erhardt <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: Eric Erhardt <[email protected]> * Update src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs Co-authored-by: Eric Erhardt <[email protected]> * Remove unncessary sentence. --------- Co-authored-by: Mitch Denny <[email protected]> Co-authored-by: Dan Moseley <[email protected]> Co-authored-by: James Newton-King <[email protected]> Co-authored-by: Eric Erhardt <[email protected]>
1 parent 9d98476 commit 9164b37

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

src/Aspire.Hosting/ApplicationModel/ResourceNotificationService.cs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,17 @@ static bool IsContinuableState(WaitBehavior waitBehavior, CustomResourceSnapshot
226226
/// <param name="cancellationToken">The cancellation token.</param>
227227
/// <returns>A task.</returns>
228228
/// <remarks>
229+
/// <para>
229230
/// This method returns a task that will complete with the resource is healthy. A resource
230-
/// without <see cref="HealthCheckAnnotation"/> annotations will be considered healthy.
231+
/// without <see cref="HealthCheckAnnotation"/> annotations will be considered healthy once
232+
/// it reaches a <see cref="KnownResourceStates.Running"/> state.
233+
/// </para>
234+
/// <para>
235+
/// If the resource enters an unavailable state such as <see cref="KnownResourceStates.FailedToStart"/> then
236+
/// this method will continue to wait to enable scenarios where a resource could be restarted and recover. To
237+
/// control this behavior use <see cref="WaitForResourceHealthyAsync(string, WaitBehavior, CancellationToken)"/>
238+
/// or configure the default behavior with <see cref="ResourceNotificationServiceOptions.DefaultWaitBehavior"/>.
239+
/// </para>
231240
/// </remarks>
232241
public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default)
233242
{
@@ -245,8 +254,22 @@ public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName
245254
/// <param name="waitBehavior">The wait behavior.</param>
246255
/// <returns>A task.</returns>
247256
/// <remarks>
257+
/// <para>
248258
/// This method returns a task that will complete with the resource is healthy. A resource
249-
/// without <see cref="HealthCheckAnnotation"/> annotations will be considered healthy.
259+
/// without <see cref="HealthCheckAnnotation"/> annotations will be considered healthy once
260+
/// it reaches a <see cref="KnownResourceStates.Running"/> state. The
261+
/// <see cref="WaitBehavior"/> controls how the wait operation behaves when the resource
262+
/// enters an unavailable state such as <see cref="KnownResourceStates.FailedToStart"/>.
263+
/// </para>
264+
/// <para>
265+
/// When <see cref="WaitBehavior.WaitOnResourceUnavailable"/> is specified the wait operation
266+
/// will continue to wait until the resource reaches a <see cref="KnownResourceStates.Running"/> state.
267+
/// </para>
268+
/// <para>
269+
/// When <see cref="WaitBehavior.StopOnResourceUnavailable"/> is specified the wait operation
270+
/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an
271+
/// unavailable state.
272+
/// </para>
250273
/// </remarks>
251274
public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, WaitBehavior waitBehavior, CancellationToken cancellationToken = default)
252275
{

src/Aspire.Hosting/ResourceBuilderExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,12 @@ public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, I
729729
/// return <see cref="HealthStatus.Healthy"/>.</para>
730730
/// <para>The <see cref="WithHealthCheck{T}(IResourceBuilder{T}, string)"/> method can be used to associate
731731
/// additional health checks with a resource.</para>
732-
/// <para>The <paramref name="waitBehavior"/> parameter can be used to control the behavior of the wait operation.</para>
732+
/// <para>The <paramref name="waitBehavior"/> parameter can be used to control the behavior of the
733+
/// wait operation. When <see cref="WaitBehavior.WaitOnResourceUnavailable"/> is specified, the wait
734+
/// operation will continue to wait until the resource becomes healthy. This is the default
735+
/// behavior with the <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource})"/> overload.</para>
736+
/// <para>When <see cref="WaitBehavior.StopOnResourceUnavailable"/> is specified, the wait operation
737+
/// will throw a <see cref="DistributedApplicationException"/> if the resource enters an unavailable state.</para>
733738
/// </remarks>
734739
/// <example>
735740
/// Start message queue before starting the worker service.

0 commit comments

Comments
 (0)