Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- tokio::run_async(async {
- let resps = Arc::new(Mutex::new(HashMap::new()));
- let resps_inner = resps.clone();
- tokio::spawn_async(async move {
- while let Some(Ok((id, data))) = await!(rx_q.next()) {
- let mut resps = resps_inner.lock().unwrap();
- resps.insert(id, data);
- }
- });
- tokio::spawn_async(async move {
- while let Some(Ok(msg)) = await!(rx_in.next()) {
- let mut resps = resps.lock().unwrap();
- unimplemented!(); /// ...
- }
- });
- })
- }
Add Comment
Please, Sign In to add comment