1 implementation of Subscribe
Aspire.Hosting (1)
Eventing\DistributedApplicationEventing.cs (1)
120public DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent
74 references to Subscribe
Aspire.Hosting (26)
Ats\BuilderExports.cs (4)
209return builder.Eventing.Subscribe<BeforeStartEvent>(async (@event, ct) => 233return builder.Eventing.Subscribe<BeforePublishEvent>(async (@event, ct) => 257return builder.Eventing.Subscribe<AfterPublishEvent>(async (@event, ct) => 281return builder.Eventing.Subscribe<AfterResourcesCreatedEvent>(async (@event, ct) =>
Ats\EventingExports.cs (4)
173return context.Eventing.Subscribe<BeforeStartEvent>((@event, _) => callback(@event)); 188return context.Eventing.Subscribe<BeforePublishEvent>((@event, _) => callback(@event)); 203return context.Eventing.Subscribe<AfterPublishEvent>((@event, _) => callback(@event)); 218return context.Eventing.Subscribe<AfterResourcesCreatedEvent>((@event, _) => callback(@event));
Dashboard\DashboardEventHandlers.cs (1)
1030eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
Devcontainers\DevcontainerPortForwardingEventingSubscriber.cs (1)
61eventing.Subscribe<ResourceEndpointsAllocatedEvent>(OnResourceEndpointsAllocatedAsync);
DistributedApplicationBuilder.cs (5)
588Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.InitializeDcpAnnotations); 589Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.WarnPersistentContainersWithoutUserSecrets); 593Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.MutateHttp2TransportAsync); 640Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.ExcludeDashboardFromManifestAsync); 645Eventing.Subscribe<BeforeStartEvent>((e, ct) => BuiltInDistributedApplicationEventSubscriptionHandlers.UpdateContainerRegistryAsync(e, options));
DistributedApplicationEventingExtensions.cs (1)
133builder.Eventing.Subscribe(callback);
Eventing\DistributedApplicationEventing.cs (2)
119/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" /> 158/// <inheritdoc cref="IDistributedApplicationEventing.Subscribe{T}(Func{T, CancellationToken, Task})" />
Lifecycle\RequiredCommandValidationEventingSubscriber.cs (1)
27eventing.Subscribe<BeforeResourceStartedEvent>(ValidateRequiredCommandsAsync);
Lifecycle\TerminalHostEventingSubscriber.cs (1)
46eventing.Subscribe<BeforeStartEvent>(ResolveTerminalHostsAsync);
Lifecycle\TerminalHostOrphanCleanupService.cs (1)
61eventing.Subscribe<BeforeStartEvent>((@event, _) =>
Orchestrator\ApplicationOrchestrator.cs (3)
76_eventing.Subscribe<ResourceEndpointsAllocatedEvent>(OnResourceEndpointsAllocated); 77_eventing.Subscribe<ConnectionStringAvailableEvent>(PublishConnectionStringValue); 79_eventing.Subscribe<BeforeResourceStartedEvent>(WaitForInBeforeResourceStartedEvent);
PublisherDistributedApplicationBuilderExtensions.cs (1)
30builder.Eventing.Subscribe<PublisherAdvertisementEvent>((e, ct) => {
TerminalResourceBuilderExtensions.cs (1)
109appBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
586builder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
Aspire.Hosting.EntityFrameworkCore (2)
EFMigrationResourceBuilderExtensions.cs (2)
39builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, ct) => 332builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, _) =>
Aspire.Hosting.Maui (6)
Lifecycle\MauiBuildQueueEventSubscriber.cs (1)
43eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
25eventing.Subscribe<AfterResourcesCreatedEvent>(async (@event, ct) =>
MauiOtlpExtensions.cs (2)
117appBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>((evt, _) => 135appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>((evt, ct) =>
Utilities\MauiAndroidEnvironmentAnnotation.cs (1)
49eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Utilities\MauiiOSEnvironmentAnnotation.cs (1)
49eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Aspire.Hosting.Maui.Tests (1)
MauiPlatformExtensionsTests.cs (1)
749appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>((evt, _) =>
Aspire.Hosting.Tests (33)
Backchannel\AppHostBackchannelTests.cs (3)
24builder.Eventing.Subscribe<BackchannelReadyEvent>((e, ct) => { 30builder.Eventing.Subscribe<BackchannelConnectedEvent>((e, ct) => { 68builder.Eventing.Subscribe<BackchannelReadyEvent>((e, ct) => {
Backchannel\AuxiliaryBackchannelTests.cs (2)
28builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) => 65builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) =>
Cli\CliOrphanDetectorTests.cs (1)
268builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) =>
DistributedApplicationTests.cs (6)
330testProgram.AppBuilder.Eventing.Subscribe<AfterResourcesCreatedEvent>((_, _) => 443testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((_, cancellationToken) => 463testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((evt, cancellationToken) => 484testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((_, cancellationToken) => 504testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((evt, cancellationToken) => 1210events.Subscribe<BeforeResourceStartedEvent>(async (e, ct) =>
Eventing\DistributedApplicationBuilderEventingTests.cs (16)
27builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 34builder.Eventing.Subscribe<DummyEvent>((@event, ct) => 59builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 66builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 91builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 98builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 124builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 133builder.Eventing.Subscribe<DummyEvent>((@event, ct) => 211builder.Eventing.Subscribe<BeforeResourceStartedEvent>((e, ct) => 236builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => 244builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 252builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => 281builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => Task.CompletedTask); 396builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => 492builder.Eventing.Subscribe<IDistributedApplicationEvent>((_, _) => Task.CompletedTask)); 504builder.Eventing.Subscribe<AbstractDummyEvent>((_, _) => Task.CompletedTask));
OperationModesTests.cs (4)
25builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 54builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 83builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 114builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => {
WithOtlpExporterTests.cs (1)
225builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) =>
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationTestFactory.cs (1)
75eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
CustomResources.AppHost (1)
TestResource.cs (1)
87eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
HealthChecksSandbox.AppHost (1)
AppHost.cs (1)
147eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
Stress.AppHost (1)
TestResource.cs (1)
201eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
TestProject.AppHost (1)
TestProgram.cs (1)
207eventing.Subscribe<AfterResourcesCreatedEvent>(OnAfterResourcesCreated);