32 references to ResourceEvent
Aspire.Hosting (15)
ApplicationModel\ResourceNotificationService.cs (11)
26private Action<ResourceEvent>? OnResourceUpdated { get; set; } 110await foreach (var resourceEvent in WatchAsync(watchToken).ConfigureAwait(false)) 181public Task<ResourceEvent> WaitForResourceHealthyAsync(string resourceName, CancellationToken cancellationToken = default) 269/// <param name="predicate">A predicate which is evaluated for each <see cref="ResourceEvent"/> for the selected resource.</param> 274public async Task<ResourceEvent> WaitForResourceAsync(string resourceName, Func<ResourceEvent, bool> predicate, CancellationToken cancellationToken = default) 278await foreach (var resourceEvent in WatchAsync(watchToken).ConfigureAwait(false)) 297public async IAsyncEnumerable<ResourceEvent> WatchAsync([EnumeratorCancellation] CancellationToken cancellationToken = default) 310var channel = Channel.CreateUnbounded<ResourceEvent>(); 312void WriteToChannel(ResourceEvent resourceEvent) => 322await foreach (var item in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false))
Dashboard\DashboardServiceData.cs (1)
59await foreach (var @event in resourceNotificationService.WatchAsync().WithCancellation(cancellationToken).ConfigureAwait(false))
Health\ResourceHealthCheckService.cs (3)
16private readonly Dictionary<string, ResourceEvent> _latestEvents = new(); 43private async Task MonitorResourceHealthAsync(ResourceEvent initialEvent, CancellationToken cancellationToken) 145async Task SlowDownMonitoringAsync(ResourceEvent lastEvent, CancellationToken cancellationToken)
Aspire.Hosting.Redis.Tests (1)
RedisFunctionalTests.cs (1)
223var latestEvent = await rns.WaitForResourceHealthyAsync(redisInsightBuilder.Resource.Name, cts.Token);
Aspire.Hosting.Testing.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
123await foreach (var resourceEvent in resourceNotificationService.WatchAsync(cancellationTokenSource.Token).ConfigureAwait(false))
Aspire.Hosting.Tests (14)
Codespaces\CodespacesUrlRewriterTests.cs (1)
83var resourceEvent = await rns.WaitForResourceAsync(
Dcp\ApplicationExecutorTests.cs (2)
86await foreach (var item in resourceNotificationService.WatchAsync()) 1012await foreach (var item in resourceNotificationService.WatchAsync())
Health\ResourceHealthCheckServiceTests.cs (4)
34var startingEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 42var healthyEvent = await rns.WaitForResourceHealthyAsync("resource").DefaultTimeout(); 68var startingEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Starting).DefaultTimeout(); 76var runningEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.State?.Text == KnownResourceStates.Running).DefaultTimeout();
ResourceNotificationTests.cs (6)
51async Task<List<ResourceEvent>> GetValuesAsync(CancellationToken cancellationToken) 53var values = new List<ResourceEvent>(); 55await foreach (var item in notificationService.WatchAsync(cancellationToken)) 104async Task<List<ResourceEvent>> GetValuesAsync(CancellationToken cancellation) 106var values = new List<ResourceEvent>(); 108await foreach (var item in notificationService.WatchAsync(cancellation))
Utils\LoggerNotificationExtensions.cs (1)
123await foreach (var resourceEvent in resourceNotificationService.WatchAsync(cancellationTokenSource.Token).ConfigureAwait(false))
Aspire.Playground.Tests (1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (1)
123await foreach (var resourceEvent in resourceNotificationService.WatchAsync(cancellationTokenSource.Token).ConfigureAwait(false))