1 implementation of Subscribe
Aspire.Hosting (1)
Eventing\DistributedApplicationEventing.cs (1)
120public DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent
81 references to Subscribe
Aspire.Hosting (27)
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)
876eventing.Subscribe<BeforeStartEvent>(OnBeforeStartAsync);
Devcontainers\DevcontainerPortForwardingEventingSubscriber.cs (1)
61eventing.Subscribe<ResourceEndpointsAllocatedEvent>(OnResourceEndpointsAllocatedAsync);
DistributedApplicationBuilder.cs (5)
614Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.InitializeDcpAnnotations); 615Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.WarnPersistentContainersWithoutUserSecrets); 619Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.MutateHttp2TransportAsync); 667Eventing.Subscribe<BeforeStartEvent>(BuiltInDistributedApplicationEventSubscriptionHandlers.ExcludeDashboardFromManifestAsync); 672Eventing.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\DotnetBuildCommandEventingSubscriber.cs (1)
23eventing.Subscribe<BeforeResourceStartedEvent>(ConfigureMultiThreadedBuildAsync);
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)
110appBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, cancellationToken) =>
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
586builder.Eventing.Subscribe<BeforeStartEvent>((data, token) =>
Aspire.Hosting.Dotnet.Tests (4)
DotnetProjectBuildCoordinatorTests.cs (4)
2174builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 2198builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 2226builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 2423builder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
Aspire.Hosting.EntityFrameworkCore (2)
EFMigrationResourceBuilderExtensions.cs (2)
40builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, ct) => 351builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, _) =>
Aspire.Hosting.Maui (6)
Lifecycle\MauiBuildQueueEventSubscriber.cs (1)
63eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Lifecycle\UnsupportedPlatformEventSubscriber.cs (1)
25eventing.Subscribe<AfterResourcesCreatedEvent>(async (@event, ct) =>
MauiOtlpExtensions.cs (2)
127appBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(async (evt, ct) => 192appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>(async (evt, ct) =>
Utilities\MauiAndroidEnvironmentAnnotation.cs (1)
47eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Utilities\MauiiOSEnvironmentAnnotation.cs (1)
47eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync);
Aspire.Hosting.Maui.Tests (1)
MauiPlatformExtensionsTests.cs (1)
977appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>((evt, _) =>
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
345builder.ApplicationBuilder.Eventing.Subscribe<BeforeStartEvent>((@event, ct) =>
Aspire.Hosting.Tests (34)
Backchannel\AppHostBackchannelTests.cs (3)
35builder.Eventing.Subscribe<BackchannelReadyEvent>((e, ct) => { 41builder.Eventing.Subscribe<BackchannelConnectedEvent>((e, ct) => { 87builder.Eventing.Subscribe<BackchannelReadyEvent>((e, ct) => {
Backchannel\AuxiliaryBackchannelTests.cs (3)
25builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) => 62builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) => 118builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((_, _) =>
Cli\CliOrphanDetectorTests.cs (1)
268builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) =>
DistributedApplicationTests.cs (6)
334testProgram.AppBuilder.Eventing.Subscribe<AfterResourcesCreatedEvent>((_, _) => 447testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((_, cancellationToken) => 467testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((evt, cancellationToken) => 488testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((_, cancellationToken) => 508testProgram.AppBuilder.Eventing.Subscribe<BeforeStartEvent>((evt, cancellationToken) => 1214events.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)
24builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 53builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 82builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => { 113builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => {
WithOtlpExporterTests.cs (1)
292builder.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);