<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IODataQueueDispatchSource",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IODataQueueDispatchSource"
  },
  "title" : "IODataQueueDispatchSource"
}
-->

# IODataQueueDispatchSource

A dispatch source that manages a shared-memory data queue.

```
class IODataQueueDispatchSource;
```

## Topics

### Configuring the Dispatch Source

[`Create`](/documentation/DriverKit/IODataQueueDispatchSource/Create)

Creates a dispatch source that you use as a shared-memory data queue.

[`init`](/documentation/DriverKit/IODataQueueDispatchSource/init)

Handles the basic initialization of the dispatch source.

[`free`](/documentation/DriverKit/IODataQueueDispatchSource/free)

Performs any final cleanup for the data-queue dispatch source.

### Adding Work to the Queue

[`SetDataServicedHandler`](/documentation/DriverKit/IODataQueueDispatchSource/SetDataServicedHandler)

Installs the handler block to execute when data is removed from the queue.

[`DataServiced`](/documentation/DriverKit/IODataQueueDispatchSource/DataServiced)

Responds to the removal of data from the queue.

[`Enqueue`](/documentation/DriverKit/IODataQueueDispatchSource/Enqueue)

Adds a single entry to the shared data queue.

[`EnqueueWithCoalesce`](/documentation/DriverKit/IODataQueueDispatchSource/EnqueueWithCoalesce)

Adds an entry to the queue, but doesn’t automatically send a data-available notification.

[`SendDataAvailable`](/documentation/DriverKit/IODataQueueDispatchSource/SendDataAvailable)

Sends a notification to observers that indicates more data is available for processing.

[`IODataQueueClientEnqueueEntryBlock`](/documentation/DriverKit/IODataQueueClientEnqueueEntryBlock)

The handler block you use to add data to a queue.

### Removing Work from the Queue

[`SetDataAvailableHandler`](/documentation/DriverKit/IODataQueueDispatchSource/SetDataAvailableHandler)

Sets the handler block to run when another object adds data to the queue.

[`DataAvailable`](/documentation/DriverKit/IODataQueueDispatchSource/DataAvailable)

Responds to the addition of new data to the queue.

[`IsDataAvailable`](/documentation/DriverKit/IODataQueueDispatchSource/IsDataAvailable)

Checks whether the data queue contains data to process.

[`Peek`](/documentation/DriverKit/IODataQueueDispatchSource/Peek)

Returns the next queue entry without removing it from the queue.

[`Dequeue`](/documentation/DriverKit/IODataQueueDispatchSource/Dequeue)

Removes the next entry from the queue.

[`DequeueWithCoalesce`](/documentation/DriverKit/IODataQueueDispatchSource/DequeueWithCoalesce)

Removes the next queue entry, but doesn’t automatically send notifications.

[`SendDataServiced`](/documentation/DriverKit/IODataQueueDispatchSource/SendDataServiced)

Notifies interested parties that you removed data from the queue.

[`IODataQueueClientDequeueEntryBlock`](/documentation/DriverKit/IODataQueueClientDequeueEntryBlock)

The handler block you use to remove data from a queue.

### Starting and Stopping the Dispatch Source

[`SetEnableWithCompletion`](/documentation/DriverKit/IODataQueueDispatchSource/SetEnableWithCompletion)

Controls the enable state of the interrupt source.

[`Cancel`](/documentation/DriverKit/IODataQueueDispatchSource/Cancel)

Cancels all callbacks from the dispatch source.

### Performing Internal Tasks

[`CopyDataAvailableHandler`](/documentation/DriverKit/IODataQueueDispatchSource/CopyDataAvailableHandler)

A private method that the dispatch source uses to detect enqueued data.

[`CopyDataServicedHandler`](/documentation/DriverKit/IODataQueueDispatchSource/CopyDataServicedHandler)

A private method that the dispatch source uses to detect dequeued data.

[`CopyMemory`](/documentation/DriverKit/IODataQueueDispatchSource/CopyMemory)

A private method that the dispatch source uses to copy memory.

[`CheckForWork`](/documentation/DriverKit/IODataQueueDispatchSource/CheckForWork)

Checks for events to handle.

### Instance Methods

[`CanEnqueueData`](/documentation/DriverKit/IODataQueueDispatchSource/CanEnqueueData-4tug8)

[`CanEnqueueData`](/documentation/DriverKit/IODataQueueDispatchSource/CanEnqueueData-3yyz2)

### Type Methods

[`GetDataQueueEntryHeaderSize`](/documentation/DriverKit/IODataQueueDispatchSource/GetDataQueueEntryHeaderSize)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)