[comment]: # (markdown: { smartypants: true }) ## All The Concurrency Models of the Rainbow 🌈
🦀 🐹 📦
## Blocking What Concurrency is NOT
```rs use std::net::TcpListener; fn main() { let listener = TcpListener::bind("127.0.0.1:7878").unwrap(); for stream in listener.incoming() { let stream = stream.unwrap(); println!("Connection established!"); } } ```
### Concurrency vs Parallelism
### Parallelism ```rs for job in jobs { thread::spawn(|| { handle_job(job); }); } ```
### Concurrency ```js $$('button').forEach(function (el) { el.addEventListener('click', function () { // do stuff }); }) ```
### Types of Concurrency
# Threads
# Event Loops
# Channels
# Async/Await