#dispatch #macos-ios #gcd #macos #ios #libdispatch

no-std dispatch2

Bindings and wrappers for Apple's Grand Central Dispatch (GCD)

2 unstable releases

0.2.0 Jan 23, 2025
0.1.0 Oct 1, 2022

#137 in macOS and iOS APIs

Download history 419/week @ 2024-11-30 906/week @ 2024-12-07 889/week @ 2024-12-14 316/week @ 2024-12-21 239/week @ 2024-12-28 770/week @ 2025-01-04 821/week @ 2025-01-11 1046/week @ 2025-01-18 1053/week @ 2025-01-25 1094/week @ 2025-02-01 1276/week @ 2025-02-08 1369/week @ 2025-02-15 1567/week @ 2025-02-22 11387/week @ 2025-03-01 30899/week @ 2025-03-08 40512/week @ 2025-03-15

84,635 downloads per month
Used in 101 crates (10 directly)

Zlib OR Apache-2.0 OR MIT

1MB
18K SLoC

dispatch2

Latest version License Documentation CI

Rust bindings to Apple's Grand Central Dispatch.

This README is kept intentionally small to consolidate the documentation, see the Rust docs for more details on this crate.

This crate is part of the objc2 project, see that for related crates.


lib.rs:

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"));

Dependencies