MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / start_timer

Method start_timer

src/executors/skip_executor.rs:49–68  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

47 (executor, tx)
48 }
49
50 pub(crate) fn start_timer(&mut self) {
51 let executor = self.executor.clone();
52 let is_skip = self.is_skip.clone();
53
54 self.timer.start(
55 slint::TimerMode::Repeated,
56 Duration::from_millis(100),
57 move || {
58 if is_skip.load(Ordering::Relaxed) {
59 let mut executor = executor.clone();
60 if executor.can_skip() {
61 slint::spawn_local(async move {
62 if let Err(e) = executor.execute_script() {
63 eprintln!("skip execute_script failed: {e}");
64 }
65 })
66 .expect("skip-play timer: no slint event loop");
67 } else {
68 executor
69 .execute_status(Status::Normal, false)
70 .expect("skip-play execute_status failed");
71 }

Callers 1

load_dataFunction · 0.45

Calls 1

execute_scriptMethod · 0.80

Tested by

no test coverage detected