1 implementation of PublishAsync
Aspire.Hosting (1)
Eventing\DistributedApplicationEventing.cs (1)
17public Task PublishAsync<T>(T @event, CancellationToken cancellationToken = default) where T : IDistributedApplicationEvent
70 references to PublishAsync
Aspire.Hosting (14)
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)
540await eventing.PublishAsync(beforeStartEvent, cancellationToken).ConfigureAwait(false);
Eventing\DistributedApplicationEventing.cs (2)
15/// <inheritdoc cref="IDistributedApplicationEventing.PublishAsync{T}(T, CancellationToken)" /> 22/// <inheritdoc cref="IDistributedApplicationEventing.PublishAsync{T}(T, CancellationToken)" />
ExternalServiceBuilderExtensions.cs (1)
147await e.Eventing.PublishAsync(new BeforeResourceStartedEvent(e.Resource, e.Services), ct).ConfigureAwait(false);
Health\ResourceHealthCheckService.cs (1)
255var task = eventing.PublishAsync(resourceReadyEvent, cancellationToken);
Orchestrator\ApplicationOrchestrator.cs (5)
132await _eventing.PublishAsync(afterEndpointsAllocatedEvent, context.CancellationToken).ConfigureAwait(false); 199await _eventing.PublishAsync(beforeResourceStartedEvent, context.CancellationToken).ConfigureAwait(false); 546await _eventing.PublishAsync(afterResourcesCreatedEvent, cancellationToken).ConfigureAwait(false); 668await _eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false); 692await _eventing.PublishAsync(createEvent(resource), cancellationToken).ConfigureAwait(false);
Publishing\PipelineExecutor.cs (2)
51await eventing.PublishAsync<BeforePublishEvent>( 58await eventing.PublishAsync<AfterPublishEvent>(
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
190await eventing.PublishAsync(beforeResourceStartedEvent, cancellationToken).ConfigureAwait(false); 264await eventing.PublishAsync(connectionStringAvailableEvent, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.Tests (4)
AzureCosmosDBExtensionsTests.cs (4)
735await builder.Eventing.PublishAsync(beforeStartEvent); 767await builder.Eventing.PublishAsync(beforeStartEvent); 796await builder.Eventing.PublishAsync(beforeStartEvent); 826await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
702await eventing.PublishAsync<ResourceEndpointsAllocatedEvent>(new(portResource, services), ct).ConfigureAwait(false); 768await eventing.PublishAsync<ResourceStoppedEvent>(new(portResource, e.Services, new(portResource, portResource.Name, stoppedSnapshot!)), ct).ConfigureAwait(false);
Aspire.Hosting.Foundry (1)
FoundryExtensions.cs (1)
325await eventing.PublishAsync(connectionStringAvailableEvent, ct).ConfigureAwait(false);
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
141await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
78await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct)
Aspire.Hosting.Maui (1)
MauiOtlpExtensions.cs (1)
125return appBuilder.Eventing.PublishAsync(new ResourceEndpointsAllocatedEvent(stubResource, evt.Services), ct);
Aspire.Hosting.Maui.Tests (1)
MauiPlatformExtensionsTests.cs (1)
250.PublishAsync(new BeforeResourceStartedEvent(platform.Resource, app.Services), CancellationToken.None);
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)
90await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct) 134await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Services), ct)
Aspire.Hosting.Python.Tests (1)
AddPythonAppTests.cs (1)
2402await eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel), CancellationToken.None);
Aspire.Hosting.Redis.Tests (5)
AddRedisTests.cs (5)
489await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 515await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 536await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 813await builder.Eventing.PublishAsync(beforeStartEvent); 865await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.Tests (28)
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);
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
304await eventing.PublishAsync(testEvent, CancellationToken.None);
RequiredCommandAnnotationTests.cs (15)
157await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 174await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 192await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 215await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 242await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 268await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 289await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 310await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 311await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 343await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 344await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 368var publishTask = eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 399await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 426var publishTask1 = eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 432await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services));
Aspire.Hosting.Yarp.Tests (2)
AddYarpTests.cs (2)
421await builder.Eventing.PublishAsync(beforeStartEvent); 446await 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);