Skip to content
Docs Try Aspire
Docs Try

ResourceNotificationService

Handle
📦 Aspire.Hosting v13.4.0
interface ResourceNotificationService extends IDisposable {
publishResourceUpdate(
resource: IResource,
state?: string,
stateStyle?: string): void;
tryGetResourceState(resourceName: string): ResourceEventDto;
waitForDependencies(resource: IResource): void;
waitForResourceHealthy(resourceName: string): ResourceEventDto;
waitForResourceState(
resourceName: string,
targetState?: string): void;
waitForResourceStates(
resourceName: string,
targetStates: string[]): string;
}

Methods

Publishes an update for a resource's state.
publishResourceUpdate(
resource: IResource,
state?: string,
stateStyle?: string): void
resource IResource
state string optional
stateStyle string optional
Tries to get the current state of a resource.
tryGetResourceState(resourceName: string): ResourceEventDto
resourceName string
ResourceEventDto
Waits for all dependencies of a resource to be ready.
waitForDependencies(resource: IResource): void
resource IResource
Waits for a resource to become healthy.
waitForResourceHealthy(resourceName: string): ResourceEventDto
resourceName string
ResourceEventDto
Waits for a resource to reach a specified state.
waitForResourceState(
resourceName: string,
targetState?: string): void
resourceName string
targetState string optional
Waits for a resource to reach one of the specified states.
waitForResourceStates(
resourceName: string,
targetStates: string[]): string
resourceName string
targetStates string[]
string