Crates.io | dispatch2 |
lib.rs | dispatch2 |
version | 0.1.0 |
source | src |
created_at | 2022-10-01 23:05:32.579543 |
updated_at | 2022-10-01 23:05:32.579543 |
description | Bindings and wrappers for the Grand Central Dispatch (GCD) |
homepage | https://www.github.com/marysaka/dispatch2 |
repository | https://www.github.com/marysaka/dispatch2.git |
max_upload_size | |
id | 678044 |
size | 70,731 |
Allows interaction with the Apple Dispatch library in a safe and unsafe way.
To use dispatch2
, add this to your Cargo.toml
:
[dependencies]
dispatch2 = "0.1.0"
use dispatch2::{Queue, QueueAttribute};
fn main() {
let queue = Queue::new("example_queue", QueueAttribute::Serial);
queue.exec_async(|| println!("Hello"));
queue.exec_sync(|| println!("World"));
}
dispatch2 is distributed under the terms of either the MIT license or the Apache License (Version 2.0), at the user's choice.
See LICENSE-APACHE and LICENSE-MIT.