Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added macros for spawning #25

Merged
merged 4 commits into from
Feb 17, 2020
Merged

Added macros for spawning #25

merged 4 commits into from
Feb 17, 2020

Conversation

mitsuhiko
Copy link
Owner

This lets one do things like this:

use procspawn::{self, spawn};

fn main() {
    procspawn::init();

    let a = 42u32;
    let b = 23u32;
    let c = 1;
    let handle = spawn!((a => new_name1, b, mut c) || -> Result<_, ()> {
        c += 1;
        Ok(new_name1 + b + c)
    });
    let value = handle.join().unwrap();

    println!("{:?}", value);
}

@mitsuhiko mitsuhiko merged commit 3eb6f8d into master Feb 17, 2020
@mitsuhiko mitsuhiko deleted the feature/macros branch February 17, 2020 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant