Skip to content

Instantly share code, notes, and snippets.

@c16a
Last active June 25, 2018 18:04
Show Gist options
  • Save c16a/1cb8bf51c856ec89b152d09357f6c81f to your computer and use it in GitHub Desktop.
Save c16a/1cb8bf51c856ec89b152d09357f6c81f to your computer and use it in GitHub Desktop.
Asynchronous programming using higher-order functions in post-2010 languages
fun main() {
async {
print("Printing GeeksQuiz from thread")
}
}
use std::thread;
fn main() {
println!("Before thread");
// fill the vector
let handle = thread::spawn(|| {
println!("Printing GeeksQuiz from threads");
})
println!("After thread");
handle.join().unwrap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment