|
|
@ -47,11 +47,11 @@ fn get_messages() -> impl Stream<Item = String> {
|
|
|
|
fn get_intervals() -> impl Stream<Item = u32> {
|
|
|
|
fn get_intervals() -> impl Stream<Item = u32> {
|
|
|
|
let (tx, rx) = trpl::channel();
|
|
|
|
let (tx, rx) = trpl::channel();
|
|
|
|
|
|
|
|
|
|
|
|
// 这里*不是* `trpl::spawn` ,是 `std::thread::spawn`!
|
|
|
|
// 这里 *不是* `trpl::spawn` ,是 `std::thread::spawn`!
|
|
|
|
thread::spawn(move || {
|
|
|
|
thread::spawn(move || {
|
|
|
|
let mut count = 0;
|
|
|
|
let mut count = 0;
|
|
|
|
loop {
|
|
|
|
loop {
|
|
|
|
// 同样, 这里*不是* `trpl::sleep` ,是 `std::thread::sleep`!
|
|
|
|
// 同样, 这里 *不是* `trpl::sleep` ,是 `std::thread::sleep`!
|
|
|
|
thread::sleep(Duration::from_millis(1));
|
|
|
|
thread::sleep(Duration::from_millis(1));
|
|
|
|
count += 1;
|
|
|
|
count += 1;
|
|
|
|
|
|
|
|
|
|
|
|