# ResourceWithWaitSupport.WaitFor

- Module: [Aspire.Hosting](/reference/api/go/aspire.hosting.md)
- Defined on: [ResourceWithWaitSupport](/reference/api/go/aspire.hosting/resourcewithwaitsupport.md)
- Version: `17.0.0`
- Kind: `method`

Waits for another resource to be ready

## Definition

```go
func (ResourceWithWaitSupport) WaitFor(
    dependency Resource,
    options ...*WaitForOptions,
) ResourceWithWaitSupport
```

## Signature

```go
WaitFor(
    dependency Resource,
    options ...*WaitForOptions,
) ResourceWithWaitSupport
```

## Parameters

- `dependency` ([`Resource`](/reference/api/go/aspire.hosting/resource.md))
- `options` (`...*WaitForOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WaitForOptions` argument.

- `WaitBehavior` ([`*WaitBehavior`](/reference/api/go/aspire.hosting/waitbehavior.md))

## Returns

[`ResourceWithWaitSupport`](/reference/api/go/aspire.hosting/resourcewithwaitsupport.md)

Returns a handle; failures surface later via `Err()`.

## Defined on

A marker interface declares no methods of its own in Go. Its functions are declared on the concrete types they apply to.

- [ResourceWithWaitSupport](/reference/api/go/aspire.hosting/resourcewithwaitsupport.md) -- `marker`

## Applies to

- [`CSharpAppResource`](/reference/api/go/aspire.hosting/csharpappresource.md)
- [`ContainerResource`](/reference/api/go/aspire.hosting/containerresource.md)
- [`DotnetToolResource`](/reference/api/go/aspire.hosting/dotnettoolresource.md)
- [`ExecutableResource`](/reference/api/go/aspire.hosting/executableresource.md)
- [`ProjectResource`](/reference/api/go/aspire.hosting/projectresource.md)
