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
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 screencapturekit::dispatch_queue::{DispatchQueue, DispatchQoS};
use screencapturekit::prelude::*;
// Create a high-priority queue for frame processing
let queue = DispatchQueue::new("com.myapp.capture", DispatchQoS::UserInteractive);
let mut stream = SCStream::new(&filter, &config);
stream.add_output_handler_with_queue(
|_sample, _type| println!("Got frame!"),
SCStreamOutputType::Screen,
Some(&queue)
);Structs§
- Dispatch
Queue - A wrapper around GCD
DispatchQueue
Enums§
- Dispatch
QoS - Quality of Service levels for dispatch queues