This commit is contained in:
azw 2024-05-08 22:10:56 +08:00
parent ea6e02768d
commit bf7c30e822
2 changed files with 14 additions and 1 deletions

View File

@ -172,9 +172,10 @@ impl App {
pub fn run() {
loop {
crate::Timer::update();
//crate::Timer::update();
App::dispatch_immsg();
App::dispatch_httprequest();
App::update_user_app();
std::thread::sleep(Duration::from_millis(1));
}
}
@ -244,6 +245,11 @@ impl App {
}
}
fn update_user_app() {
let user_app = App::instance().borrow_mut().user_app.clone();
user_app.as_ref().unwrap().borrow_mut().update();
}
fn fetch_immsg(&mut self) -> Rc::<RefCell::<r9::ListHead::<IMMsgNode>>> {
r9::ListHead::replace_init(&self.im_msgs, &self.im_work_msgs);
return self.im_work_msgs.clone();

View File

@ -33,4 +33,11 @@ impl<T> Queue<T> {
}
}
pub fn empty(&self) -> bool {
if !self.work_list.borrow().empty() {
return false
}
return self.msg_list.borrow().empty()
}
}