# ResourceNotificationService

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

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

## Definition

```go
type ResourceNotificationService interface{}
```

## Methods

- [PublishResourceUpdate](/reference/api/go/aspire.hosting/resourcenotificationservice/publishresourceupdate.md) -- `method` -- Publishes an update for a resource's state.
  ```go
  PublishResourceUpdate(resource Resource, options ...*PublishResourceUpdateOptions) error
  ```
- [TryGetResourceState](/reference/api/go/aspire.hosting/resourcenotificationservice/trygetresourcestate.md) -- `method` -- Tries to get the current state of a resource.
  ```go
  TryGetResourceState(resourceName string) (*ResourceEventDto, error)
  ```
- [WaitForDependencies](/reference/api/go/aspire.hosting/resourcenotificationservice/waitfordependencies.md) -- `method` -- Waits for all dependencies of a resource to be ready.
  ```go
  WaitForDependencies(resource Resource) error
  ```
- [WaitForResourceHealthy](/reference/api/go/aspire.hosting/resourcenotificationservice/waitforresourcehealthy.md) -- `method` -- Waits for a resource to become healthy.
  ```go
  WaitForResourceHealthy(resourceName string) (*ResourceEventDto, error)
  ```
- [WaitForResourceState](/reference/api/go/aspire.hosting/resourcenotificationservice/waitforresourcestate.md) -- `method` -- Waits for a resource to reach a specified state.
  ```go
  WaitForResourceState(resourceName string, options ...*WaitForResourceStateOptions) error
  ```
- [WaitForResourceStates](/reference/api/go/aspire.hosting/resourcenotificationservice/waitforresourcestates.md) -- `method` -- Waits for a resource to reach one of the specified states.
  ```go
  WaitForResourceStates(resourceName string, targetStates []string) (string, error)
  ```
