Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

ResourceNotificationService

Handle
📦 Aspire.Hosting v17.0.0

A service that allows publishing and subscribing to changes in the state of a resource.

type ResourceNotificationService interface{}

Methods

Publishes an update for a resource's state.
PublishResourceUpdate(
resource Resource,
options ...*PublishResourceUpdateOptions,
) error
resourceResource
options...*PublishResourceUpdateOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*PublishResourceUpdateOptions argument.

State*string
StateStyle*string
error

Returns error.

Tries to get the current state of a resource.
TryGetResourceState(resourceName string) (*ResourceEventDto, error)
resourceNamestring
(*ResourceEventDto, error)

Returns (*ResourceEventDto, error).

Waits for all dependencies of a resource to be ready.
WaitForDependencies(resource Resource) error
resourceResource
error

Returns error.

Waits for a resource to become healthy.
WaitForResourceHealthy(resourceName string) (*ResourceEventDto, error)
resourceNamestring
(*ResourceEventDto, error)

Returns (*ResourceEventDto, error).

Waits for a resource to reach a specified state.
WaitForResourceState(
resourceName string,
options ...*WaitForResourceStateOptions,
) error
resourceNamestring
options...*WaitForResourceStateOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WaitForResourceStateOptions argument.

TargetState*string
error

Returns error.

Waits for a resource to reach one of the specified states.
WaitForResourceStates(
resourceName string,
targetStates []string,
) (string, error)
resourceNamestring
targetStates[]string
(string, error)

Returns (string, error).