#coroutine #green #fiber #thread

greentask

Library to use coroutines as green tasks

2 unstable releases

Uses old Rust 2015

0.2.0 Aug 4, 2017
0.1.0 Jul 30, 2016

#15 in #green

MIT/Apache

6KB
93 lines

greentask

Rust library to pass tasks into green coroutines and take the results.

Usage:

strcut In(&'static str);
struct Out(&'static str);

let mut resumer = spawn(|mut yielder, first_in| {
    let second_in = yielder.yield_with(Out("first out"));
    Out("second out")
});

resumer.resume_with(In("first in"));
resumer.resume_with(In("second in"));

lib.rs:

Library to use coroutines as tasks with own attached data types.

Usage:

strcut In(&'static str);
struct Out(&'static str);

let mut resumer = spawn(|mut yielder, first_in| {
    let second_in = yielder.yield_with(Out("first out"));
    Out("second out")
});

resumer.resume_with(In("first in"));
resumer.resume_with(In("second in"));

Dependencies

~635KB
~11K SLoC