use std::thread;
use std::time::Duration;
use std::sync::mpsc;

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

    thread::spawn(move || {
        let vals = vec![
            String::from("1000のバイオリン"),
            String::from("24K Magic"),
            String::from("365日の紙飛行機"),
            String::from("4分33秒"),
        ];
        for val in vals {
            tx.send(val).unwrap();
            thread::sleep(Duration::from_secs(1));
        }
    }); 

    for recv in rx {
        println!("{recv}");
    }
}
