fn rw() {
        let (tx, rx) = mpsc::channel();

        thread::spawn(move || {
            let vals = vec![
                String::from("1"),
                String::from("2"),
                String::from("3"),
                String::from("4"),
            ];

            for val in vals {
                tx.send(val).unwrap();
                thread::sleep(Duration::from_secs(1));
            }
        });

        for received in rx {
            println!("Got : {}", received);
        }
    }
// sending multiple values and seeing receiver waiting
sending multiple values and seeing receiver waiting
sending multiple values and seeing receiver waiting
fn rw() {
        let (tx, rx) = mpsc::channel();
        thread::spawn(move || {
            let vals = vec![
                String::from("1"),
                String::from("2"),
                String::from("3"),
                String::from("4"),
            ];
            for val in vals {
                tx.send(val).unwrap();
                thread::sleep(Duration::from_secs(1));
            }
        });
        for received in rx {
            println!("Got : {}", received);
        }
    }
fn rw ( ) { let ( tx , rx ) = mpsc :: channel ( ) ; thread :: spawn ( move | | { let vals = vec ! [ String from ( " " ) String from ( " " ) String from ( " " ) String from ( " " ) ] ; for val in vals { tx . send ( val ) . unwrap ( ) ; thread :: sleep ( Duration :: from_secs ( 1 ) ) ; } } ) ; for received in rx { println ! ( " " received ) ; } }
sending multiple values and seeing receiver waiting
sending multiple values and seeing receiver waiting