2 implementations of Eventing
Aspire.Hosting.Testing (2)
DistributedApplicationTestingBuilder.cs (2)
526public IDistributedApplicationEventing Eventing => innerBuilder.Eventing; 691public IDistributedApplicationEventing Eventing => _innerBuilder.Eventing;
244 references to Eventing
Aspire.Hosting.Azure.EntraId.Tests (9)
EntraIdProvisioningTests.cs (9)
1173await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1287await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1314await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1339var publish = builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), cts.Token); 1382await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(web.Resource, app.Services), CancellationToken.None); 1400await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1458await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1491await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None); 1512await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new ResourceEndpointsAllocatedEvent(web.Resource, app.Services), CancellationToken.None);
Aspire.Hosting.Azure.Kusto.Tests (1)
AzureKustoHealthCheckTests.cs (1)
96await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(kusto.Resource, app.Services), cancellationToken);
Aspire.Hosting.Azure.Tests (9)
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));
DurableTaskResourceExtensionsTests.cs (2)
62await builder.Eventing.PublishAsync(new ResourceReadyEvent(taskHub.Resource, app.Services)); 80await builder.Eventing.PublishAsync(new ResourceReadyEvent(taskHub.Resource, app.Services));
FoundryExtensionsTests.cs (1)
355builder.Eventing
Aspire.Hosting.DevTunnels.Tests (2)
DevTunnelResourceBuilderExtensionsTests.cs (2)
236await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout(); 278await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.Dotnet.Tests (45)
DotnetProjectBuildCoordinatorTests.cs (35)
83await builder.Eventing.PublishAsync( 121await builder.Eventing.PublishAsync( 227await builder.Eventing.PublishAsync( 246await builder.Eventing.PublishAsync( 311await builder.Eventing.PublishAsync( 720await builder.Eventing.PublishAsync( 740await builder.Eventing.PublishAsync( 784await builder.Eventing.PublishAsync( 1730builder.Eventing.PublishAsync( 1779builder.Eventing.PublishAsync( 1819builder.Eventing.PublishAsync( 1844await builder.Eventing.PublishAsync( 1856await builder.Eventing.PublishAsync( 1868builder.Eventing.PublishAsync( 1894await builder.Eventing.PublishAsync( 1914await builder.Eventing.PublishAsync( 1917await builder.Eventing.PublishAsync( 1929await builder.Eventing.PublishAsync( 1934builder.Eventing.PublishAsync( 2014await builder.Eventing.PublishAsync( 2073await builder.Eventing.PublishAsync( 2193await builder.Eventing.PublishAsync( 2291builder.Eventing.PublishAsync( 2415await builder.Eventing.PublishAsync( 2432await builder.Eventing.PublishAsync( 2644await builder.Eventing.PublishAsync( 2692await builder.Eventing.PublishAsync( 2761await builder.Eventing.PublishAsync( 2771var secondStartTask = builder.Eventing.PublishAsync( 2897await builder.Eventing.PublishAsync( 2920await builder.Eventing.PublishAsync( 3179builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 3203builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 3231builder.Eventing.Subscribe<BeforeStartEvent>((@event, _) => 3428builder.Eventing.Subscribe<BeforeStartEvent>((_, _) =>
DotnetProjectPathTests.cs (3)
139builder.Eventing.PublishAsync( 171builder.Eventing.PublishAsync( 295builder.Eventing.PublishAsync(
DotnetProjectResourceTests.cs (1)
510await builder.Eventing.PublishAsync(
MsTestResourceTests.cs (6)
63await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, 110await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, 115await Assert.ThrowsAsync<DistributedApplicationException>(() => builder.Eventing.PublishAsync(new BeforeStartEvent( 132await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource.Resource, app.Services), 134await Assert.ThrowsAsync<DistributedApplicationException>(() => builder.Eventing.PublishAsync( 155await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services,
Aspire.Hosting.EntityFrameworkCore.Tests (2)
EFBuildReadinessTests.cs (2)
74await builder.Eventing.PublishAsync( 108await builder.Eventing.PublishAsync(
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
927await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
Aspire.Hosting.Garnet.Tests (1)
AddGarnetTests.cs (1)
102var connectionAvailable = builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(garnet, app.Services), cts.Token);
Aspire.Hosting.Go.Tests (3)
GoRunDebuggingTests.cs (3)
113await builder.Eventing.PublishAsync(new BeforeStartEvent( 248await builder.Eventing.PublishAsync(new BeforeStartEvent( 442await builder.Eventing.PublishAsync(new BeforeStartEvent(
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.Kafka.Tests (4)
AddKafkaTests.cs (4)
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)); 294await appBuilder.Eventing.PublishAsync(
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
81await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.Maui.Tests (3)
MauiPlatformExtensionsTests.cs (3)
977appBuilder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>((evt, _) => 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();
Aspire.Hosting.MongoDB.Tests (12)
AddMongoDBTests.cs (10)
141await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>())); 171await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>())); 499await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 524await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 550await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 571await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 609await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 650await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 670await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 688await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
ReplicaSet\AddMongoDBReplicaSetTests.cs (1)
224await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel));
SingleMemberReplicaSetTests.cs (1)
130await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, app.Services.GetRequiredService<DistributedApplicationModel>()));
Aspire.Hosting.MySql.Tests (1)
AddMySqlTests.cs (1)
423await appBuilder.Eventing.PublishAsync(
Aspire.Hosting.OpenAI.Tests (2)
OpenAIExtensionTests.cs (2)
25var initialization = resources.Select(resource => builder.Eventing.PublishAsync( 26new InitializeResourceEvent(resource, builder.Eventing, loggerService, notifications, app.Services), cts.Token)).ToArray();
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
237builder.Eventing.Subscribe<ConnectionStringAvailableEvent>(qdrantResource, (e, ct) =>
Aspire.Hosting.Redis.Tests (3)
AddRedisTests.cs (3)
1000await builder.Eventing.PublishAsync(beforeStartEvent); 1039await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, appModel)); 1087await builder.Eventing.PublishAsync(beforeStartEvent);
Aspire.Hosting.SqlServer.Tests (3)
AddSqlServerTests.cs (3)
322await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(sqlServer.Resource, app.Services)); 323await builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(db.Resource, app.Services)); 353var connectionAvailable = builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(resource, app.Services), cts.Token);
Aspire.Hosting.Testing.Tests (1)
DashboardTestingBuilderTests.cs (1)
121builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) =>
Aspire.Hosting.Tests (122)
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)
30builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) => 67builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((e, ct) => 123builder.Eventing.Subscribe<AuxiliaryBackchannelConnectedEvent>((_, _) =>
Cli\CliOrphanDetectorTests.cs (1)
268builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) =>
Cli\TestingCollectorTests.cs (1)
75builder.Eventing.Subscribe<BeforeStartEvent>((e, _) => ConfigureTestAsync(e.Services.GetRequiredService<ResourceNotificationService>()));
Cli\TestRunCoordinatorEndToEndTests.cs (2)
42builder.Eventing.Subscribe<BackchannelReadyEvent>((e, _) => 123builder.Eventing.Subscribe<BackchannelReadyEvent>((e, _) =>
ContainerRegistryResourceTests.cs (12)
432await builder.Eventing.PublishAsync(beforeStartEvent); 559await builder.Eventing.PublishAsync(beforeStartEvent); 580await builder.Eventing.PublishAsync(beforeStartEvent); 604await builder.Eventing.PublishAsync(beforeStartEvent); 626await builder.Eventing.PublishAsync(beforeStartEvent); 649await builder.Eventing.PublishAsync(beforeStartEvent); 685await builder.Eventing.PublishAsync(beforeStartEvent); 709await builder.Eventing.PublishAsync(beforeStartEvent); 739await builder.Eventing.PublishAsync(beforeStartEvent); 760await builder.Eventing.PublishAsync(beforeStartEvent); 780await builder.Eventing.PublishAsync(beforeStartEvent); 801await builder.Eventing.PublishAsync(beforeStartEvent);
Dcp\DcpExecutorTests.cs (3)
5282builder.Eventing.Subscribe<ResourceEndpointsAllocatedEvent>(async (@event, ct) => 5296distributedApplicationEventing: builder.Eventing); 11469var read = builder.Eventing.PublishAsync(new ConnectionStringAvailableEvent(context.Resource, app.Services), context.CancellationToken);
DistributedApplicationTests.cs (1)
197builder.Eventing.Subscribe<BeforeStartEvent>((e, _) =>
Eventing\DistributedApplicationBuilderEventingTests.cs (24)
27builder.Eventing.Subscribe<DummyEvent>(async (_, ct) => 38await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingConcurrent, cts.Token).DefaultTimeout(); 59builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 66builder.Eventing.Subscribe<DummyEvent>((@event, ct) => 72var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingSequential); 91builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 98builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 105var pendingPublish = builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.BlockingConcurrent); 123builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 130builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 137await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingConcurrent).DefaultTimeout(); 156builder.Eventing.Subscribe<DummyEvent>(async (@event, ct) => 165builder.Eventing.Subscribe<DummyEvent>((@event, ct) => 172await builder.Eventing.PublishAsync(new DummyEvent(), EventDispatchBehavior.NonBlockingSequential).DefaultTimeout(); 205Assert.Equal(builder.Eventing, eventing); 243builder.Eventing.Subscribe<BeforeResourceStartedEvent>((e, ct) => 268builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => 276builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => 284builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => 313builder.Eventing.Subscribe<AfterEndpointsAllocatedEvent>((e, ct) => Task.CompletedTask); 428builder.Eventing.Subscribe<AfterResourcesCreatedEvent>((e, ct) => 524builder.Eventing.Subscribe<IDistributedApplicationEvent>((_, _) => Task.CompletedTask)); 536builder.Eventing.Subscribe<AbstractDummyEvent>((_, _) => Task.CompletedTask)); 549builder.Eventing.Subscribe<IDistributedApplicationResourceEvent>(resource.Resource, (_, _) => Task.CompletedTask));
Health\ResourceHealthCheckServiceTests.cs (1)
661builder.Eventing.Subscribe<ResourceReadyEvent>(resource.Resource, (_, _) => throw new InvalidOperationException("ResourceReadyEvent failed"));
InteractionServiceTests.cs (2)
217builder.Eventing.Subscribe<BeforeStartEvent>(async (e, ct) => 255builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => throw new InvalidOperationException("Before-start failed."));
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) => {
Orchestrator\ApplicationOrchestratorTests.cs (42)
53applicationEventing: builder.Eventing); 57builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token); 105applicationEventing: builder.Eventing); 110builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout(); 140applicationEventing: builder.Eventing); 144builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout(); 176applicationEventing: builder.Eventing); 180builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout(); 187builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout(); 206applicationEventing: builder.Eventing); 210builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout(); 214builder.Eventing, EventDispatchBehavior.BlockingSequential, cts.Token).DefaultTimeout(); 245await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default); 271await builder.Eventing.PublishResourceEndpointsAllocatedAsync(new(frontend.Resource, app.Services), default); 311applicationEventing: builder.Eventing); 315[new(frontend.Resource, app.Services)], builder.Eventing, dispatchBehavior, cts.Token); 371applicationEventing: builder.Eventing, dashboardOptions: new() { DashboardUrl = dashboardUrl }); 376await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 416applicationEventing: builder.Eventing); 418await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 419await orchestrator.PublishEndpointsAllocatedAsync([new(manager.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 443applicationEventing: builder.Eventing); 446var publish = orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 480applicationEventing: builder.Eventing); 482await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 501applicationEventing: builder.Eventing); 504await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default).DefaultTimeout(); 528applicationEventing: builder.Eventing); 530await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 549applicationEventing: builder.Eventing); 551await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 577applicationEventing: builder.Eventing); 579await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 583await orchestrator.PublishEndpointsAllocatedAsync([new(frontend.Resource, app.Services)], builder.Eventing, EventDispatchBehavior.BlockingSequential, default); 611var orchestrator = CreateOrchestrator(model, notificationService: notifications, dcpEvents: events, applicationEventing: builder.Eventing); 1159builder.Eventing.Subscribe<BeforeResourceStartedEvent>(resource, (_, _) => 1166notifications, dcpEvents: events, applicationEventing: builder.Eventing); 1211builder.Eventing.Subscribe<ConnectionStringAvailableEvent>(replicaSet.Resource, (_, _) => 1218var initialization = builder.Eventing.PublishAsync(new InitializeResourceEvent( 1220builder.Eventing, 1481applicationEventing: builder.Eventing); 1543applicationEventing: builder.Eventing,
ProjectRebuilderResourceTests.cs (4)
32await builder.Eventing.PublishAsync( 36await builder.Eventing.PublishAsync( 70await builder.Eventing.PublishAsync( 103await builder.Eventing.PublishAsync(
ProjectResourceTests.cs (1)
1127var publishTask = builder.Eventing.PublishAsync(
Terminals\ResourceTerminalCatalogTests.cs (1)
265await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model));
WithBindMountTests.cs (1)
191builder.Eventing.Subscribe<BeforeResourceStartedEvent>(container.Resource, (_, _) =>
WithOtlpExporterTests.cs (2)
294builder.Eventing.Subscribe<BeforeStartEvent>((e, ct) => 326await builder.Eventing.PublishAsync(beforeStartEvent);
WithTerminalTests.cs (14)
356await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 411await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 447await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 525await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 615await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 667await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1063await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1079await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1097await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1427await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1449await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1476await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model)); 1498await Assert.ThrowsAsync<IOException>(async () => await builder.Eventing.PublishAsync(new BeforeStartEvent(app.Services, model))); 1551await cleanupService.SubscribeAsync(builder.Eventing, executionContext, CancellationToken.None);
Aspire.Hosting.Yarp.Tests (2)
AddYarpTests.cs (2)
444await builder.Eventing.PublishAsync(beforeStartEvent); 469await builder.Eventing.PublishAsync(beforeStartEvent);