Available on crate feature
dispatch only.Expand description
Grand Central Dispatch queue and synchronization wrappers. 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
UserInteractiveQoSfor 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::{dispatch_async_and_wait, DispatchQueue, DispatchQoS};
// Create a high-priority queue for frame processing
let queue = DispatchQueue::new("com.myapp.capture", DispatchQoS::UserInteractive);
dispatch_async_and_wait(&queue, || {
// do queue-bound work here
});Structs§
- Dispatch
Group - Wrapper around
DispatchGroup. - Dispatch
Queue - A wrapper around GCD
DispatchQueue - Dispatch
Semaphore - Wrapper around
DispatchSemaphore. - Dispatch
Source - Minimal timer-backed
DispatchSourcewrapper.
Enums§
- Dispatch
QoS - Quality of Service levels for dispatch queues
Functions§
- dispatch_
apply - Run
workfor everyiterationonqueue, waiting for all iterations to finish. - dispatch_
async - Submit
worktoqueueand return immediately. - dispatch_
async_ and_ wait - Submit
worktoqueueand wait until it finishes.