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

no-std dispatch2

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

3 releases (breaking)

0.3.0 Apr 19, 2025
0.2.0 Jan 23, 2025
0.1.0 Oct 1, 2022

#122 in macOS and iOS APIs

Download history 800/week @ 2025-01-12 1069/week @ 2025-01-19 1083/week @ 2025-01-26 1170/week @ 2025-02-02 1188/week @ 2025-02-09 1398/week @ 2025-02-16 1629/week @ 2025-02-23 11485/week @ 2025-03-02 34477/week @ 2025-03-09 48021/week @ 2025-03-16 53210/week @ 2025-03-23 48294/week @ 2025-03-30 57900/week @ 2025-04-06 48886/week @ 2025-04-13 86817/week @ 2025-04-20 90248/week @ 2025-04-27

286,265 downloads per month
Used in 1,396 crates (49 directly)

Zlib OR Apache-2.0 OR MIT

1.5MB
20K SLoC

Apple's Dispatch (Grand Central Dispatch)

This crate provides a safe and sound interface to Apple's Grand Central dispatch.

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

Example

use dispatch2::{DispatchQueue, DispatchQueueAttr};

let queue = DispatchQueue::new("example_queue", DispatchQueueAttr::SERIAL);
queue.exec_async(|| println!("Hello"));
queue.exec_sync(|| println!("World"));

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.

Dependencies