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