2 ms·
Rust explicitly has "Send" and "non-Send" futures that can execute either on any thread, or always on the same thread. Details depend on the executor, and you c
by pornel 3y ago
Rust explicitly has "Send" and "non-Send" futures that can execute either on any thread, or always on the same thread. Details depend on the executor, and you can roll your own if you want.
This works in Rust:
let thread_s = spawn(join!(state1(yes), send(message), receive(message2));
let thread_r = spawn(join!(state1(yes), receive(message), send(message2));