---
title: "asyncAndWait(flags:execute:)"
framework: dispatch
role: symbol
role_heading: Instance Method
path: "dispatch/dispatchqueue/asyncandwait(flags:execute:)"
---

# asyncAndWait(flags:execute:)

## Declaration

```swift
func asyncAndWait<T>(flags: DispatchWorkItemFlags, execute work: () throws -> T) rethrows -> T
```
