6 releases
0.1.5 | Jun 27, 2024 |
---|---|
0.1.4 | Jun 18, 2024 |
#635 in Asynchronous
255 downloads per month
21KB
311 lines
Handshake
Symmetric one time use channels.
Example
Allows each end of the handshake to send or receive information for bi-directional movement of data:
let (u, v) = oneshot_handshake::channel::<Box<str>>();
let combine = |x, y| format!("{} {}!", x, y);
'_task_a: {
u.join("Handle Communication".into(), combine)
.unwrap()
.map(|s| println!("{}", s));
} // None
'_task_b: {
v.join("Symmetrically".into(), combine)
.unwrap()
.map(|s| println!("{}", s));
} // Some(())