mirror of https://github.com/sayanarijit/xplr
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
353 B
Rust
13 lines
353 B
Rust
4 years ago
|
use crate::app::{ExternalMsg, MsgIn, Task};
|
||
|
use std::sync::mpsc::Sender;
|
||
|
use std::thread;
|
||
|
use std::time::Duration;
|
||
|
|
||
|
pub fn start_auto_refreshing(tx: Sender<Task>) {
|
||
|
thread::spawn(move || loop {
|
||
|
tx.send(Task::new(3, MsgIn::External(ExternalMsg::Refresh), None))
|
||
|
.unwrap();
|
||
|
thread::sleep(Duration::from_secs(1));
|
||
|
});
|
||
|
}
|