feat(core): add heartbeat handling

This commit is contained in:
Federico Terzi 2021-08-06 19:25:58 +02:00
parent 103699ec36
commit 36400afab4
3 changed files with 3 additions and 0 deletions

View File

@ -58,6 +58,7 @@ impl<'a> funnel::Source<'a> for UISource<'a> {
UIEvent::ContextMenuClick(context_item_id) => {
EventType::ContextMenuClicked(ContextMenuClickedEvent { context_item_id })
}
UIEvent::Heartbeat => EventType::Heartbeat,
},
}
}

View File

@ -157,6 +157,7 @@ fn worker_main(args: CliModuleArgs) -> i32 {
.run(Box::new(move |event| {
if let Err(error) = engine_ui_event_sender.send(event) {
error!("unable to send UIEvent to engine: {}", error);
panic!("broken UI->Engine channel");
}
}))
.expect("unable to run main eventloop");

View File

@ -50,6 +50,7 @@ pub enum EventType {
ProcessingError(String),
ExitRequested(ExitMode),
Exit(ExitMode),
Heartbeat,
// Inputs
Keyboard(input::KeyboardEvent),