MCPcopy Index your code
hub / github.com/SSheldon/rust-dispatch

github.com/SSheldon/rust-dispatch @0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.0 ↗ · + Follow
82 symbols 179 edges 8 files 31 documented · 38%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust wrapper for Apple's Grand Central Dispatch (GCD).

GCD is an implementation of task parallelism that allows tasks to be submitted to queues where they are scheduled to execute.

For more information, see Apple's Grand Central Dispatch reference.

  • Documentation: http://ssheldon.github.io/rust-objc/dispatch/
  • Crate: https://crates.io/crates/dispatch

Serial Queues

Serial queues execute tasks serially in FIFO order. The application's main queue is serial and can be accessed through the Queue::main function.

use dispatch::{Queue, QueueAttribute};

let queue = Queue::create("com.example.rust", QueueAttribute::Serial);
queue.async(|| println!("Hello"));
queue.async(|| println!("World"));

Concurrent Queues

Concurrent dispatch queues execute tasks concurrently. GCD provides global concurrent queues that can be accessed through the Queue::global function.

Queue has two methods that can simplify processing data in parallel, foreach and map:

use dispatch::{Queue, QueuePriority};

let queue = Queue::global(QueuePriority::Default);

let mut nums = vec![1, 2];
queue.foreach(&mut nums, |x| *x += 1);
assert!(nums == [2, 3]);

let nums = queue.map(nums, |x| x.to_string());
assert!(nums[0] == "2");

Core symbols most depended-on inside this repo

async_increment
called by 10
src/queue.rs
exec_sync
called by 6
src/queue.rs
context_and_function
called by 5
src/lib.rs
exec_async
called by 5
src/group.rs
clone
called by 5
src/queue.rs
clone
called by 4
src/sem.rs
clone
called by 4
src/group.rs
time_after_delay
called by 3
src/lib.rs

Shape

Method 42
Function 29
Class 9
Enum 2

Languages

Rust100%

Modules by API surface

src/queue.rs35 symbols
src/group.rs14 symbols
src/sem.rs12 symbols
src/lib.rs9 symbols
src/once.rs5 symbols
src/ffi.rs4 symbols
examples/main.rs2 symbols
tests-ios/prelude.rs1 symbols

For agents

$ claude mcp add rust-dispatch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact