42 instantiations of ResourceEndpointsAllocatedEvent
Aspire.Hosting (1)
Dcp\DcpExecutor.cs (1)
250endpointEvents.Add(new ResourceEndpointsAllocatedEvent(resource, _executionContext.Services));
Aspire.Hosting.Azure.EntraId.Tests (9)
EntraIdProvisioningTests.cs (9)
1172await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1286await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1313await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1338var publish = builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), cts.Token); 1381await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), CancellationToken.None); 1399await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1457await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1490await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1511await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
Aspire.Hosting.DevTunnels (1)
DevTunnelMonitor.cs (1)
633await _eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(port, _services), cancellationToken)
Aspire.Hosting.Maui (2)
MauiOtlpExtensions.cs (2)
209appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(stubResource, evt.Services), ct)); 524await eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(tunnelConfig.OtlpStub, services), cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Maui.Tests (6)
MauiPlatformExtensionsTests.cs (6)
775await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout(); 832new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), 844new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), 892new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), 942new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), 999await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout();
Aspire.Hosting.Tests (23)
HealthCheckTests.cs (1)
97await eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(resource.Resource, app.Services));
Orchestrator\ApplicationOrchestratorTests.cs (21)
50[new(first.Resource, app.Services), new(second.Resource, app.Services)], 84[new(first.Resource, app.Services), new(second.Resource, app.Services)], 120await orchestrator.PublishEndpointsAllocatedAsync([new(first.Resource, app.Services)], 127await orchestrator.PublishEndpointsAllocatedAsync([new(second.Resource, app.Services)], 150await orchestrator.PublishEndpointsAllocatedAsync([new(resource.Resource, app.Services)], 154await orchestrator.PublishEndpointsAllocatedAsync([new(other.Resource, app.Services)], 186await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default); 212await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default); 256[new(frontend.Resource, app.Services)], builder.Eventing, dispatchBehavior, cts.Token); 317await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 359await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 360await orchestrator.PublishEndpointsAllocatedAsync([new(manager.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 387var publish = orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 423await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 445await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout(); 471await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 492await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 520await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 524await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default);
WithUrlsTests.cs (1)
88await e.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(custom, e.Services), EventDispatchBehavior.BlockingConcurrent, ct);
30 references to ResourceEndpointsAllocatedEvent
Aspire.Hosting (17)
ApplicationModel\ResourceEndpointsAllocatedEvent.cs (1)
16/// <see cref="DistributedApplicationEventingExtensions.PublishResourceEndpointsAllocatedAsync(IDistributedApplicationEventing, ResourceEndpointsAllocatedEvent, CancellationToken)"/>
Ats\EventingExports.cs (1)
136internal static IResourceBuilder<T> OnResourceEndpointsAllocated<T>(this IResourceBuilder<T> builder, Func<ResourceEndpointsAllocatedEvent, Task> callback)
Dcp\DcpExecutor.cs (1)
243var endpointEvents = new List<ResourceEndpointsAllocatedEvent>();
Dcp\DcpExecutorEvents.cs (1)
10internal record OnEndpointsAllocatedContext(CancellationToken CancellationToken, IReadOnlyList<ResourceEndpointsAllocatedEvent> Events);
Devcontainers\DevcontainerPortForwardingEventingSubscriber.cs (2)
31public Task OnResourceEndpointsAllocatedAsync(ResourceEndpointsAllocatedEvent @event, CancellationToken cancellationToken) 61eventing.Subscribe<ResourceEndpointsAllocatedEvent>(OnResourceEndpointsAllocatedAsync);
DistributedApplication.cs (1)
650logger.LogWarning("{EventName} is obsolete and is no longer raised by the DCP executor. Use {ResourceEventName} to observe per-resource endpoint allocation.", nameof(AfterEndpointsAllocatedEvent), nameof(ResourceEndpointsAllocatedEvent));
DistributedApplicationEventingExtensions.cs (4)
30public static Task PublishResourceEndpointsAllocatedAsync(this IDistributedApplicationEventing eventing, ResourceEndpointsAllocatedEvent @event, CancellationToken cancellationToken) => 47public static Task PublishResourceEndpointsAllocatedAsync(this IDistributedApplicationEventing eventing, ResourceEndpointsAllocatedEvent @event, EventDispatchBehavior dispatchBehavior, CancellationToken cancellationToken) 145/// Subscribes a callback to the <see cref="ResourceEndpointsAllocatedEvent"/> event for <paramref name="builder"/>. 153public static IResourceBuilder<T> OnResourceEndpointsAllocated<T>(this IResourceBuilder<T> builder, Func<T, ResourceEndpointsAllocatedEvent, CancellationToken, Task> callback)
Orchestrator\ApplicationOrchestrator.cs (3)
205IReadOnlyList<ResourceEndpointsAllocatedEvent> events, 212foreach (var endpointEvent in events) 217foreach (var endpointEvent in events)
ResourceBuilderExtensions.cs (3)
2251/// <see cref="ResourceEndpointsAllocatedEvent"/> handlers run.<br/> 2316/// <see cref="ResourceEndpointsAllocatedEvent"/> handlers run.<br/> 2484/// but before <see cref="ResourceEndpointsAllocatedEvent"/> handlers run.<br/>
Aspire.Hosting.DevTunnels.Tests (5)
DevTunnelMonitorTests.cs (5)
113test.App.Services.GetRequiredService<IDistributedApplicationEventing>().Subscribe<ResourceEndpointsAllocatedEvent>(test.Port, async (_, ct) => 278.Subscribe<ResourceEndpointsAllocatedEvent>(test.Port, async (_, ct) => 316test.App.Services.GetRequiredService<IDistributedApplicationEventing>().Subscribe<ResourceEndpointsAllocatedEvent>(test.Port, 756test.App.Services.GetRequiredService<IDistributedApplicationEventing>().Subscribe<ResourceEndpointsAllocatedEvent>(test.Port, async (_, ct) => 777test.App.Services.GetRequiredService<IDistributedApplicationEventing>().Subscribe<ResourceEndpointsAllocatedEvent>(test.Port, (_, _) =>
Aspire.Hosting.Maui (1)
MauiOtlpExtensions.cs (1)
192appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>(async (evt, ct) =>
Aspire.Hosting.Maui.Tests (1)
MauiPlatformExtensionsTests.cs (1)
977appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>((evt, _) =>
Aspire.Hosting.Tests (6)
Dcp\DcpExecutorTests.cs (5)
4959eventing.Subscribe<ResourceEndpointsAllocatedEvent>((@event, ct) => 4963observedEvents.Enqueue(nameof(ResourceEndpointsAllocatedEvent)); 5019eventName => Assert.Equal(nameof(ResourceEndpointsAllocatedEvent), eventName), 5212builder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>(async (@event, ct) => 5245eventing.Subscribe<ResourceEndpointsAllocatedEvent>(async (@event, ct) =>
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
323w.Message?.Contains(nameof(ResourceEndpointsAllocatedEvent), StringComparison.Ordinal) == true);