1 implementation of PublishAsync
Aspire.Hosting (1)
Eventing\DistributedApplicationEventing.cs (1)
18public Task PublishAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent
228 references to PublishAsync
Aspire.Hosting (13)
ConnectionStringBuilderExtensions.cs (2)
93await @evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(r, @evt.Services), ct).ConfigureAwait(false); 103await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct)
DistributedApplication.cs (1)
648await eventing.PublishAsync(beforeStartEvent, cancellationToken).ConfigureAwait(false);
Eventing\DistributedApplicationEventing.cs (2)
16/// <inheritdoc cref="IDistributedApplicationEventing.PublishAsync{T}(T, CancellationToken)" /> 23/// <inheritdoc cref="IDistributedApplicationEventing.PublishAsync{T}(T, CancellationToken)" />
ExternalServiceBuilderExtensions.cs (1)
168await e.Eventing.PublishAsync(new BeforeResourceStartedEvent(e.Resource, e.Services), ct).ConfigureAwait(false);
Health\ResourceHealthCheckService.cs (1)
267var task = eventing.PublishAsync(resourceReadyEvent, cancellationToken);
Orchestrator\ApplicationOrchestrator.cs (4)
281await _eventing.PublishAsync(beforeResourceStartedEvent, context.CancellationToken).ConfigureAwait(false); 629await _eventing.PublishAsync(afterResourcesCreatedEvent, cancellationToken).ConfigureAwait(false); 751await _eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); 775await _eventing.PublishAsync(createEvent(resource), cancellationToken).ConfigureAwait(false);
Publishing\PipelineExecutor.cs (2)
57await eventing.PublishAsync<BeforePublishEvent>( 64await eventing.PublishAsync<AfterPublishEvent>(
Aspire.Hosting.Azure (2)
AzureProvisioningController.cs (2)
3915await eventing.PublishAsync(beforeResourceStartedEvent, cancellationToken).ConfigureAwait(false); 4102await eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.EntraId (1)
EntraIdResourceExtensions.cs (1)
131await evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, evt.Services), cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.EntraId.Tests (1)
EntraIdInitializationTests.cs (1)
323await eventing.PublishAsync(new InitializeResourceEvent(resource, eventing, loggerService, notifications, app.Services));
Aspire.Hosting.Azure.Tests (8)
AzureCosmosDBExtensionsTests.cs (6)
807await builder.Eventing.PublishAsync(beforeStartEvent); 839await builder.Eventing.PublishAsync(beforeStartEvent); 868await builder.Eventing.PublishAsync(beforeStartEvent); 898await builder.Eventing.PublishAsync(beforeStartEvent); 1141() => builder.Eventing.PublishAsync(new ResourceReadyEvent(cosmos.Resource, app.Services))); 1158await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(cosmos.Resource, app.Services));
AzureEnvironmentResourceExtensionsTests.cs (1)
559await eventing.PublishAsync(new InitializeResourceEvent(
FoundryExtensionsTests.cs (1)
355.PublishAsync(new ResourceReadyEvent(foundry.Resource, app.Services), cancellation.Token)
Aspire.Hosting.Blazor.Tests (1)
BlazorHostedExtensionsTests.cs (1)
616await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.Browsers.Tests (1)
BrowserLogsBuilderExtensionsTests.cs (1)
1358await eventing.PublishAsync(new ResourceReadyEvent(web.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.DevTunnels (1)
DevTunnelMonitor.cs (1)
633await _eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(port, _services), cancellationToken)
Aspire.Hosting.DevTunnels.Tests (2)
DevTunnelResourceBuilderExtensionsTests.cs (2)
224await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout(); 264await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.Dotnet.Tests (16)
DotnetProjectBuildCoordinatorTests.cs (15)
74await builder.Eventing.PublishAsync( 112await builder.Eventing.PublishAsync( 218await builder.Eventing.PublishAsync( 235await builder.Eventing.PublishAsync( 429await builder.Eventing.PublishAsync( 449await builder.Eventing.PublishAsync( 1427await builder.Eventing.PublishAsync( 1444await builder.Eventing.PublishAsync( 1651await builder.Eventing.PublishAsync( 1699await builder.Eventing.PublishAsync( 1768await builder.Eventing.PublishAsync( 1778var secondStartTask = builder.Eventing.PublishAsync( 1904await builder.Eventing.PublishAsync( 1927await builder.Eventing.PublishAsync( 4050await builder.Eventing.PublishAsync(
DotnetProjectResourceTests.cs (1)
534await builder.Eventing.PublishAsync(
Aspire.Hosting.EntityFrameworkCore.Tests (2)
EFBuildReadinessTests.cs (2)
71await builder.Eventing.PublishAsync( 103await builder.Eventing.PublishAsync(
Aspire.Hosting.Foundry (1)
FoundryExtensions.cs (1)
445await eventing.PublishAsync(connectionStringAvailableEvent, ct).ConfigureAwait(false);
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
875await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.Java.Tests (16)
AddJavaAppTests.cs (4)
746() => builder.Eventing.PublishAsync( 765() => builder.Eventing.PublishAsync( 792await builder.Eventing.PublishAsync( 853() => builder.Eventing.PublishAsync(
AddQuarkusAppTests.cs (3)
96await builder.Eventing.PublishAsync( 113await builder.Eventing.PublishAsync( 285() => builder.Eventing.PublishAsync(
AddSpringBootAppTests.cs (9)
21await builder.Eventing.PublishAsync( 38await builder.Eventing.PublishAsync( 55await builder.Eventing.PublishAsync( 75await runBuilder.Eventing.PublishAsync( 113await builder.Eventing.PublishAsync( 136await builder.Eventing.PublishAsync( 189() => builder.Eventing.PublishAsync( 210() => runBuilder.Eventing.PublishAsync( 237await builder.Eventing.PublishAsync(
Aspire.Hosting.JavaScript.Tests (1)
RequiredCommandTests.cs (1)
233await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
Aspire.Hosting.Kafka.Tests (3)
AddKafkaTests.cs (3)
31await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(kafka.Resource, app.Services)); 47await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(kafka1.Resource, app.Services)); 48await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(kafka2.Resource, app.Services));
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
81await builder.Eventing.PublishAsync(beforeStartEvent);
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 (59)
MauiBuildQueueTests.cs (38)
57var eventTask = Task.Run(() => env.Eventing.PublishAsync( 77await env.Eventing.PublishAsync( 90var task1 = Task.Run(() => env.Eventing.PublishAsync( 97var task2 = Task.Run(() => env.Eventing.PublishAsync( 118var task1 = Task.Run(() => env.Eventing.PublishAsync( 139var task2 = Task.Run(() => env.Eventing.PublishAsync( 173var eventTask = Task.Run(() => env.Eventing.PublishAsync( 190var task1 = Task.Run(() => env.Eventing.PublishAsync( 194var task2 = Task.Run(() => env.Eventing.PublishAsync( 221() => env.Eventing.PublishAsync( 235var task1 = Task.Run(() => env.Eventing.PublishAsync( 243var task2 = Task.Run(() => env.Eventing.PublishAsync( 258var task3 = env.Eventing.PublishAsync( 272await env.Eventing.PublishAsync( 285await env.Eventing.PublishAsync( 293await env.Eventing.PublishAsync( 351var task1 = Task.Run(() => env.Eventing.PublishAsync( 358var parentTask = env.Eventing.PublishAsync( 375await env.Eventing.PublishAsync( 385await env.Eventing.PublishAsync( 416await eventing.PublishAsync( 454await eventing.PublishAsync( 475() => env.Eventing.PublishAsync( 522var task1 = Task.Run(() => env.Eventing.PublishAsync( 530var task2 = Task.Run(() => env.Eventing.PublishAsync( 561var eventTask = Task.Run(() => env.Eventing.PublishAsync( 596await env.Eventing.PublishAsync( 618var task1 = Task.Run(() => env.Eventing.PublishAsync( 695await env.Eventing.PublishAsync( 698await env.Eventing.PublishAsync( 849await env.Eventing.PublishAsync( 867var nextStartTask = Task.Run(() => env.Eventing.PublishAsync( 937await env.Eventing.PublishAsync( 957var nextStartTask = Task.Run(() => env.Eventing.PublishAsync( 1044var task1 = Task.Run(() => env.Eventing.PublishAsync( 1054var task2 = Task.Run(() => env.Eventing.PublishAsync( 1058var task3 = Task.Run(() => env.Eventing.PublishAsync( 1101() => env.Eventing.PublishAsync(
MauiiOSValidationTests.cs (6)
36.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 62.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None) 87.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 108.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None) 127.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 146.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None)
MauiPlatformExtensionsTests.cs (15)
296.PublishAsync(new BeforeResourceStartedEvent(platform.Resource, app.Services), CancellationToken.None) 594await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services), CancellationToken.None).DefaultTimeout(); 775await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout(); 831await appBuilder.Eventing.PublishAsync( 843await appBuilder.Eventing.PublishAsync( 891await appBuilder.Eventing.PublishAsync( 941await appBuilder.Eventing.PublishAsync( 995await appBuilder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()), CancellationToken.None).DefaultTimeout(); 999await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout(); 1119appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1145appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1174appBuilder.Eventing.PublishAsync( 1225appBuilder.Eventing.PublishAsync( 1249await appBuilder.Eventing.PublishAsync( 1341var beforeStartTask = appBuilder.Eventing.PublishAsync(
Aspire.Hosting.MongoDB (2)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (2)
126await evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, evt.Services), ct) 131await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(resource, evt.Services), ct)
Aspire.Hosting.MongoDB.Tests (16)
AddMongoDBTests.cs (10)
140await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>())); 170await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>())); 469await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 494await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 520await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 541await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 579await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 620await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 640await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 658await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
ReplicaSet\AddMongoDBReplicaSetTests.cs (5)
224await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 348await eventing.PublishAsync(new ResourceStoppedEvent(mongo1.Resource, app.Services, stoppedResourceEvent)); 352await eventing.PublishAsync(new BeforeResourceStartedEvent(mongo1.Resource, app.Services)); 358await eventing.PublishAsync(new ResourceReadyEvent(mongo1.Resource, app.Services), staleReadyCts.Token); 362await eventing.PublishAsync(new ResourceReadyEvent(mongo1.Resource, app.Services));
SingleMemberReplicaSetTests.cs (1)
125await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
260await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 291builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services));
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (2)
91await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct) 136await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct)
Aspire.Hosting.Python.Tests (1)
AddPythonAppTests.cs (1)
2592await eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel), CancellationToken.None);
Aspire.Hosting.Redis.Tests (8)
AddRedisTests.cs (8)
304await eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 330await eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 563await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 589await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 610await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 938await builder.Eventing.PublishAsync(beforeStartEvent); 975await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 1011await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
321await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(sqlServer.Resource, app.Services)); 322await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(db.Resource, app.Services));
Aspire.Hosting.Tests (58)
ContainerRegistryResourceTests.cs (12)
522await builder.Eventing.PublishAsync(beforeStartEvent); 543await builder.Eventing.PublishAsync(beforeStartEvent); 567await builder.Eventing.PublishAsync(beforeStartEvent); 589await builder.Eventing.PublishAsync(beforeStartEvent); 612await builder.Eventing.PublishAsync(beforeStartEvent); 648await builder.Eventing.PublishAsync(beforeStartEvent); 672await builder.Eventing.PublishAsync(beforeStartEvent); 702await builder.Eventing.PublishAsync(beforeStartEvent); 723await builder.Eventing.PublishAsync(beforeStartEvent); 743await builder.Eventing.PublishAsync(beforeStartEvent); 764await builder.Eventing.PublishAsync(beforeStartEvent); 785await builder.Eventing.PublishAsync(beforeStartEvent);
Dcp\DcpExecutorTests.cs (5)
6629await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 6669await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 11154await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 11225await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 11271await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel));
Eventing\DistributedApplicationBuilderEventingTests.cs (3)
332await eventing.PublishAsync(testEvent, CancellationToken.None); 431await eventing.PublishAsync(testEvent, CancellationToken.None); 454await eventing.PublishAsync(testEvent, CancellationToken.None);
HealthCheckTests.cs (1)
97await eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(resource.Resource, app.Services));
Orchestrator\ApplicationOrchestratorTests.cs (1)
1140await @event.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, @event.Services), ct);
ProjectRebuilderResourceTests.cs (3)
30await builder.Eventing.PublishAsync( 34await builder.Eventing.PublishAsync( 66await builder.Eventing.PublishAsync(
ProjectResourceTests.cs (1)
1070var publishTask = builder.Eventing.PublishAsync(
RequiredCommandAnnotationTests.cs (17)
156await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 173await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 191await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 214await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 241await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 267await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 288await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 309await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 310await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 340await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 341await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 375await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 376await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 400var publishTask = eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 431await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 458var publishTask1 = eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 464await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services));
Terminals\ResourceTerminalCatalogTests.cs (1)
265await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
WithOtlpExporterTests.cs (1)
324await builder.Eventing.PublishAsync(beforeStartEvent);
WithTerminalTests.cs (13)
302await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 357await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 393await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 471await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 561await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 613await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1009await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1025await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1043await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1373await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1395await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1420await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1442await Assert.ThrowsAsync<IOException>(async () => await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)));
Aspire.Hosting.Yarp.Tests (2)
AddYarpTests.cs (2)
444await builder.Eventing.PublishAsync(beforeStartEvent); 469await builder.Eventing.PublishAsync(beforeStartEvent);
CustomResources.AppHost (3)
TalkingClockResource.cs (3)
66await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, services), token); 67await eventing.PublishAsync(new BeforeResourceStartedEvent(resource.TickHand, services), token); 68await eventing.PublishAsync(new BeforeResourceStartedEvent(resource.TockHand, services), token);