Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marysaka/dispatch2
Rust bindings and wrappers for the Grand Central Dispatch (GCD)
https://github.com/marysaka/dispatch2
Last synced: 6 days ago
JSON representation
Rust bindings and wrappers for the Grand Central Dispatch (GCD)
- Host: GitHub
- URL: https://github.com/marysaka/dispatch2
- Owner: marysaka
- License: apache-2.0
- Created: 2022-07-09T15:17:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-20T13:59:23.000Z (7 months ago)
- Last Synced: 2024-10-05T17:17:41.853Z (about 1 month ago)
- Language: Rust
- Size: 38.1 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# dispatch2
Allows interaction with the [Apple Dispatch](https://developer.apple.com/documentation/dispatch) library in a safe and unsafe way.
## Usage
To use `dispatch2`, add this to your `Cargo.toml`:
```toml
[dependencies]
dispatch2 = "0.1.0"
```## Example
```rust
use dispatch2::{Queue, QueueAttribute};fn main() {
let queue = Queue::new("example_queue", QueueAttribute::Serial);
queue.exec_async(|| println!("Hello"));
queue.exec_sync(|| println!("World"));
}
```## License
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](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT).