promissory

Crates.iopromissory
lib.rspromissory
version0.1.3
sourcesrc
created_at2021-03-14 00:32:21.064521
updated_at2021-03-14 07:53:40.445647
descriptionOne-shot value exhange between threads
homepage
repository
max_upload_size
id368548
size38,051
Colette Kerr (electroCutie)

documentation

README

One-shot value exhange between threads. The consumer thread may await the producer thread Both the producer and consumer are single use

Just a wrapper around a std::mpsc channel with an API that makes it impossible to use more than once

Example

let (send, recv) = promissory::promissory();
std::thread::spawn(move || send.fulfill(42u32));
assert_eq!(42, recv.await_value()?;
Commit count: 0

cargo fmt