async(execute:)
Submits a work item for asynchronous execution on a dispatch queue.
- iOS
- 8.0+
- macOS
- 10.10+
func async(execute workItem: DispatchWorkItem)
Parameters
- execute
The work item to be invoked on the queue.
async(execute:)
is the fundamental mechanism for submitting work items to a dispatch queue.
Calls to async(execute:)
always return immediately after the work item has been submitted, and never wait for the work item to be invoked.
The target queue determines whether the work item will be invoked serially or concurrently with respect to other work items submitted to that same queue. Serial queues are processed concurrently with respect to each other.