Crate dispatch2

Source
Expand description

§Apple’s Dispatch (Grand Central Dispatch)

This crate provides a safe and sound interface to Apple’s Grand Central dispatch, as well as the ability to drop into lower-level bindings (ffi module).

See Apple’s documentation and the source code for libdispatch for more details.

§Example

use dispatch2::{Queue, QueueAttribute};

let queue = Queue::new("example_queue", QueueAttribute::Serial);
queue.exec_async(|| println!("Hello"));
queue.exec_sync(|| println!("World"));

Re-exports§

pub use self::group::*;
pub use self::object::*;
pub use self::queue::*;
pub use self::semaphore::*;

Modules§

ffi
Raw bindings to Apple’s Grand Central Dispatch (GCD).
group
Dispatch group definition.
object
Dispatch object definition.
queue
Dispatch queue definition.
semaphore
Dispatch semaphore definition.

Structs§

MainThreadBound
Make a type that can only be used on the main thread be Send + Sync.
Once
A low-level synchronization primitive for one-time global execution.

Enums§

QualityOfServiceClass
Quality of service that specify the priorities for executing tasks.
WaitError
Wait error.

Functions§

run_on_main
Submit the given closure to the runloop on the main thread.