1 implementation of PublishAsync
Aspire.Hosting (1)
Eventing\DistributedApplicationEventing.cs (1)
18public Task PublishAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent
206 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)
283await _eventing.PublishAsync(beforeResourceStartedEvent, context.CancellationToken).ConfigureAwait(false); 639await _eventing.PublishAsync(afterResourcesCreatedEvent, cancellationToken).ConfigureAwait(false); 761await _eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); 785await _eventing.PublishAsync(createEvent(resource), cancellationToken).ConfigureAwait(false);
Publishing\PipelineExecutor.cs (2)
60await eventing.PublishAsync<BeforePublishEvent>( 67await eventing.PublishAsync<AfterPublishEvent>(
Aspire.Hosting.Azure (2)
AzureProvisioningController.cs (2)
3918await eventing.PublishAsync(beforeResourceStartedEvent, cancellationToken).ConfigureAwait(false); 4105await eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false);
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)
562await eventing.PublishAsync(new InitializeResourceEvent(
FoundryExtensionsTests.cs (1)
351.PublishAsync(new ResourceReadyEvent(foundry.Resource, app.Services), cancellation.Token)
Aspire.Hosting.Blazor.Tests (1)
BlazorHostedExtensionsTests.cs (1)
543await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.Browsers.Tests (1)
BrowserLogsBuilderExtensionsTests.cs (1)
1359await eventing.PublishAsync(new ResourceReadyEvent(web.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
757await eventing.PublishAsync<ResourceEndpointsAllocatedEvent>(new(portResource, services), ct).ConfigureAwait(false); 829await eventing.PublishAsync<ResourceStoppedEvent>(new(portResource, e.Services, new(portResource, portResource.Name, stoppedSnapshot!)), ct).ConfigureAwait(false);
Aspire.Hosting.DevTunnels.Tests (3)
DevTunnelResourceBuilderExtensionsTests.cs (3)
225await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout(); 265await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout(); 759await builder.Eventing.PublishAsync(new ResourceReadyEvent(tunnel.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.Dotnet.Tests (9)
DotnetProjectBuildCoordinatorTests.cs (9)
896await builder.Eventing.PublishAsync( 913await builder.Eventing.PublishAsync( 1120await builder.Eventing.PublishAsync( 1168await builder.Eventing.PublishAsync( 1237await builder.Eventing.PublishAsync( 1247var secondStartTask = builder.Eventing.PublishAsync( 1373await builder.Eventing.PublishAsync( 1396await builder.Eventing.PublishAsync( 3069await 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)
705await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
80await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct)
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)
297.PublishAsync(new BeforeResourceStartedEvent(platform.Resource, app.Services), CancellationToken.None) 595await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services), CancellationToken.None).DefaultTimeout(); 776await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout(); 832await appBuilder.Eventing.PublishAsync( 844await appBuilder.Eventing.PublishAsync( 892await appBuilder.Eventing.PublishAsync( 942await appBuilder.Eventing.PublishAsync( 996await appBuilder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()), CancellationToken.None).DefaultTimeout(); 1000await appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(dashboard.Resource, app.Services), CancellationToken.None).DefaultTimeout(); 1120appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1146appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1175appBuilder.Eventing.PublishAsync( 1226appBuilder.Eventing.PublishAsync( 1250await appBuilder.Eventing.PublishAsync( 1342var beforeStartTask = appBuilder.Eventing.PublishAsync(
Aspire.Hosting.MongoDB (2)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (2)
134await evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, evt.Services), ct) 139await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(resource, evt.Services), ct)
Aspire.Hosting.MongoDB.Tests (12)
AddMongoDBTests.cs (7)
398await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 423await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 449await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 470await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 492await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 512await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 530await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
ReplicaSet\AddMongoDBReplicaSetTests.cs (5)
199await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 323await eventing.PublishAsync(new ResourceStoppedEvent(mongo1.Resource, app.Services, stoppedResourceEvent)); 327await eventing.PublishAsync(new BeforeResourceStartedEvent(mongo1.Resource, app.Services)); 333await eventing.PublishAsync(new ResourceReadyEvent(mongo1.Resource, app.Services), staleReadyCts.Token); 337await eventing.PublishAsync(new ResourceReadyEvent(mongo1.Resource, app.Services));
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
244await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 275builder.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)
2593await 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)); 329await eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 561await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 587await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 608await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 936await builder.Eventing.PublishAsync(beforeStartEvent); 973await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 1009await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.Tests (50)
ContainerRegistryResourceTests.cs (12)
523await builder.Eventing.PublishAsync(beforeStartEvent); 544await builder.Eventing.PublishAsync(beforeStartEvent); 568await builder.Eventing.PublishAsync(beforeStartEvent); 590await builder.Eventing.PublishAsync(beforeStartEvent); 613await builder.Eventing.PublishAsync(beforeStartEvent); 649await builder.Eventing.PublishAsync(beforeStartEvent); 673await builder.Eventing.PublishAsync(beforeStartEvent); 703await builder.Eventing.PublishAsync(beforeStartEvent); 724await builder.Eventing.PublishAsync(beforeStartEvent); 744await builder.Eventing.PublishAsync(beforeStartEvent); 765await builder.Eventing.PublishAsync(beforeStartEvent); 786await builder.Eventing.PublishAsync(beforeStartEvent);
Dcp\DcpExecutorTests.cs (5)
6017await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 6057await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 9967await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 10038await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, distributedAppModel)); 10084await 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)
1095await @event.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, @event.Services), ct);
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));
WithOtlpExporterTests.cs (1)
324await builder.Eventing.PublishAsync(beforeStartEvent);
WithTerminalTests.cs (10)
295await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 345await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 423await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 511await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 563await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 959await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 975await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 993await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1323await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1345await 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);