36 references to WaitBehavior
Aspire.Hosting (25)
ApplicationModel\ResourceNotificationService.cs (17)
33
internal
WaitBehavior
DefaultWaitBehavior { get; set; }
54
DefaultWaitBehavior =
WaitBehavior
.StopOnResourceUnavailable;
73
DefaultWaitBehavior = serviceProvider.GetService<IOptions<ResourceNotificationServiceOptions>>()?.Value.DefaultWaitBehavior ??
WaitBehavior
.StopOnResourceUnavailable;
143
private async Task WaitUntilHealthyAsync(IResource resource, IResource dependency,
WaitBehavior
waitBehavior, CancellationToken cancellationToken)
165
if (waitBehavior ==
WaitBehavior
.StopOnResourceUnavailable)
209
static bool IsContinuableState(
WaitBehavior
waitBehavior, CustomResourceSnapshot snapshot) =>
212
WaitBehavior
.WaitOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running,
213
WaitBehavior
.StopOnResourceUnavailable => snapshot.State?.Text == KnownResourceStates.Running ||
238
/// control this behavior use <see cref="WaitForResourceHealthyAsync(string,
WaitBehavior
, CancellationToken)"/>
262
/// <see cref="
WaitBehavior
"/> controls how the wait operation behaves when the resource
266
/// When <see cref="
WaitBehavior
.WaitOnResourceUnavailable"/> is specified the wait operation
270
/// When <see cref="
WaitBehavior
.StopOnResourceUnavailable"/> is specified the wait operation
275
public async Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName,
WaitBehavior
waitBehavior, CancellationToken cancellationToken = default)
291
static bool ShouldYield(
WaitBehavior
waitBehavior, CustomResourceSnapshot snapshot) =>
294
WaitBehavior
.WaitOnResourceUnavailable => snapshot.HealthStatus == HealthStatus.Healthy,
295
WaitBehavior
.StopOnResourceUnavailable => snapshot.HealthStatus == HealthStatus.Healthy ||
794
public
WaitBehavior
DefaultWaitBehavior { get; set; }
ApplicationModel\WaitAnnotation.cs (1)
33
public
WaitBehavior
? WaitBehavior { get; init; }
DistributedApplicationBuilder.cs (2)
247
o.DefaultWaitBehavior = options.DisableDashboard ?
WaitBehavior
.StopOnResourceUnavailable :
WaitBehavior
.WaitOnResourceUnavailable;
ResourceBuilderExtensions.cs (5)
1064
/// resources, calling <see cref="WaitFor{T}(IResourceBuilder{T}, IResourceBuilder{IResource},
WaitBehavior
)"/> also results
1070
/// wait operation. When <see cref="
WaitBehavior
.WaitOnResourceUnavailable"/> is specified, the wait
1073
/// <para>When <see cref="
WaitBehavior
.StopOnResourceUnavailable"/> is specified, the wait operation
1086
public static IResourceBuilder<T> WaitFor<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency,
WaitBehavior
waitBehavior) where T : IResourceWithWaitSupport
1094
private static IResourceBuilder<T> WaitForCore<T>(this IResourceBuilder<T> builder, IResourceBuilder<IResource> dependency,
WaitBehavior
? waitBehavior, bool addRelationship) where T : IResourceWithWaitSupport
Aspire.Hosting.Tests (11)
WaitForTests.cs (11)
207
.WaitFor(dependency,
WaitBehavior
.StopOnResourceUnavailable);
237
dependency.WaitFor(failToStart,
WaitBehavior
.StopOnResourceUnavailable);
245
WaitBehavior
.StopOnResourceUnavailable
261
dependency.WaitFor(failToStart,
WaitBehavior
.StopOnResourceUnavailable);
269
WaitBehavior
.WaitOnResourceUnavailable
278
[InlineData(
WaitBehavior
.WaitOnResourceUnavailable, typeof(TimeoutException), "The operation has timed out.")]
279
[InlineData(
WaitBehavior
.StopOnResourceUnavailable, typeof(DistributedApplicationException), "Stopped waiting for resource 'redis' to become healthy because it failed to start.")]
280
public async Task WhenWaitBehaviorIsMissingWaitForResourceHealthyAsyncShouldUseDefaultWaitBehavior(
WaitBehavior
defaultWaitBehavior, Type exceptionType, string exceptionMessage)
292
dependency.WaitFor(failToStart,
WaitBehavior
.StopOnResourceUnavailable);
352
.WaitFor(dependency,
WaitBehavior
.WaitOnResourceUnavailable);
393
o.DefaultWaitBehavior =
WaitBehavior
.WaitOnResourceUnavailable;