Contents

DispatchWorkItem

The work you want to perform, encapsulated in a way that lets you attach a completion handle or execution dependencies.

Declaration

class DispatchWorkItem

Overview

A DispatchWorkItem encapsulates work to be performed on a dispatch queue or within a dispatch group. You can also use a work item as a DispatchSource event, registration, or cancellation handler.

Topics

Creating a Work Item

Executing the Work Item

Adding a Completion Handler

Waiting for the Completion of a Work Item

Canceling a Work Item

Initializers

See Also

Queues and Tasks