Skip to main content

Module dispatch_queue

Module dispatch_queue 

Source
Available on crate feature dispatch only.
Expand description

Dispatch Queue wrapper for custom queue management

This module provides a safe Rust wrapper around GCD (Grand Central Dispatch) queues that can be used with ScreenCaptureKit streams.

§When to Use Custom Queues

By default, stream output handlers are called on a system-managed queue. Use a custom queue when you need:

  • Priority control - Use UserInteractive QoS for low-latency UI updates
  • Thread isolation - Ensure handlers run on a specific queue
  • Performance tuning - Adjust queue priority based on your app’s needs

§Example

use apple_cf::dispatch_queue::{DispatchQueue, DispatchQoS};

// Create a high-priority queue for frame processing
let queue = DispatchQueue::new("com.myapp.capture", DispatchQoS::UserInteractive);
// Pass `queue.as_ptr()` into any framework that accepts a `dispatch_queue_t`.

Structs§

DispatchGroup
Wrapper around DispatchGroup.
DispatchQueue
A wrapper around GCD DispatchQueue
DispatchSemaphore
Wrapper around DispatchSemaphore.
DispatchSource
Minimal timer-backed DispatchSource wrapper.

Enums§

DispatchQoS
Quality of Service levels for dispatch queues