---
title: "ODQuerySetDispatchQueue(_:_:)"
framework: opendirectory
role: symbol
role_heading: Function
path: "opendirectory/odquerysetdispatchqueue(_:_:)"
---

# ODQuerySetDispatchQueue(_:_:)

Retrieves results from a query asynchronously by adding the query to a dispatch queue.

## Declaration

```swift
func ODQuerySetDispatchQueue(_ query: ODQueryRef!, _ queue: dispatch_queue_t!)
```

## Parameters

- `query`: The query.
- `queue`: The dispatch queue.

## Discussion

Discussion When the query is complete, the query’s callback function is called with both inResults and inError set to NULL.

## See Also

### Related Documentation

- [ODQueryCallback](opendirectory/odquerycallback.md)

### Working with Queries

- [ODQueryCopyResults(_:_:_:)](opendirectory/odquerycopyresults(_:_:_:).md)
- [ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:)](opendirectory/odquerycreatewithnode(_:_:_:_:_:_:_:_:_:).md)
- [ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:)](opendirectory/odquerycreatewithnodetype(_:_:_:_:_:_:_:_:_:).md)
- [ODQueryGetTypeID()](opendirectory/odquerygettypeid().md)
- [ODQueryScheduleWithRunLoop(_:_:_:)](opendirectory/odqueryschedulewithrunloop(_:_:_:).md)
- [ODQuerySetCallback(_:_:_:)](opendirectory/odquerysetcallback(_:_:_:).md)
- [ODQuerySynchronize(_:)](opendirectory/odquerysynchronize(_:).md)
- [ODQueryUnscheduleFromRunLoop(_:_:_:)](opendirectory/odqueryunschedulefromrunloop(_:_:_:).md)
