Skip to content
Docs Try Aspire

IDistributedApplicationLifecycleHook Methods

Interface Methods 3 members
Defines an interface for hooks that are executed during the lifecycle of a distributed application.
AfterEndpointsAllocatedAsync(DistributedApplicationModel, CancellationToken) Section titled AfterEndpointsAllocatedAsync(DistributedApplicationModel, CancellationToken) virtual Task
Executes after the orchestrator allocates endpoints for resources in the application model.
public interface IDistributedApplicationLifecycleHook
{
public virtual Task AfterEndpointsAllocatedAsync(
DistributedApplicationModel appModel,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
appModel DistributedApplicationModel The distributed application model.
cancellationToken CancellationToken optional A Threading.CancellationToken.
Task A Tasks.Task representing the asynchronous operation.
AfterResourcesCreatedAsync(DistributedApplicationModel, CancellationToken) Section titled AfterResourcesCreatedAsync(DistributedApplicationModel, CancellationToken) virtual Task
Executes after the orchestrator has created the resources in the application model.
public interface IDistributedApplicationLifecycleHook
{
public virtual Task AfterResourcesCreatedAsync(
DistributedApplicationModel appModel,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
appModel DistributedApplicationModel The DistributedApplicationModel for the distributed application.
cancellationToken CancellationToken optional A Threading.CancellationToken.
Task A Tasks.Task representing the asynchronous operation.
There is no guarantee that the resources have fully started or are in a working state when this method is called.
BeforeStartAsync(DistributedApplicationModel, CancellationToken) Section titled BeforeStartAsync(DistributedApplicationModel, CancellationToken) virtual Task
Executes before the distributed application starts.
public interface IDistributedApplicationLifecycleHook
{
public virtual Task BeforeStartAsync(
DistributedApplicationModel appModel,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
appModel DistributedApplicationModel The distributed application model.
cancellationToken CancellationToken optional A Threading.CancellationToken.
Task A Tasks.Task representing the asynchronous operation.