dispatch-executor 0.1.0

An asynchronous executor for Apple's Grand Central Dispatch
docs.rs failed to build dispatch-executor-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

dispatch-executor

An asynchronous executor for Apple's Grand Central Dispatch.

This crate provides an Executor that can be used to spawn and run asynchronous tasks on a GCD dispatch queue.

It also provides a Handle type that allows for sending !Send values between threads, as long as they are only accessed on the thread that owns them.

Example

use dispatch_executor::{Executor, MainThreadMarker};

async fn example() {
    let mtm = MainThreadMarker::new().unwrap();
    let executor = Executor::main_thread(mtm);

    let task = executor.spawn(async {
        println!("Hello, world!");
        42
    });

    assert_eq!(task.await, 42);
}