Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created August 21, 2018 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/6eec30d3d0da7e75a4d05e55d813f9ea to your computer and use it in GitHub Desktop.
Save rust-play/6eec30d3d0da7e75a4d05e55d813f9ea to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn main() {
let (tx, rx): (mpsc::SyncSender<Vec<i16>>, mpsc::Receiver<Vec<i16>>) = mpsc::sync_channel(10 as usize);
listen("127.0.0.1:8000",|out| {
move |msg| {
let d = rx.recv().expect("ERROR RECV");
out.send("done")
}
}).unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment