Handle idle time between fetch results #212

Merged
wojtek merged 18 commits from 211---handle-idle-time-between-fetch-results into main 2024-09-08 23:23:53 +02:00
2 changed files with 8 additions and 4 deletions
Showing only changes of commit 616f4c9f35 - Show all commits

View File

@ -69,10 +69,14 @@ impl AppMachine<AppFetch> {
}; };
let fetch = AppFetch::new(fetch_rx); let fetch = AppFetch::new(fetch_rx);
AppMachine::app_fetch_next(inner, fetch, true) AppMachine::app_fetch(inner, fetch, true)
} }
pub fn app_fetch_next(inner: AppInner, fetch: AppFetch, first: bool) -> App { pub fn app_fetch_next(inner: AppInner, fetch: AppFetch) -> App {
Self::app_fetch(inner, fetch, false)
}
pub fn app_fetch(inner: AppInner, fetch: AppFetch, first: bool) -> App {
match fetch.fetch_rx.try_recv() { match fetch.fetch_rx.try_recv() {
Ok(fetch_result) => match fetch_result { Ok(fetch_result) => match fetch_result {
Ok(next_match) => { Ok(next_match) => {
@ -176,7 +180,7 @@ impl IAppEventFetch for AppMachine<AppFetch> {
type APP = App; type APP = App;
fn fetch_result_ready(self) -> Self::APP { fn fetch_result_ready(self) -> Self::APP {
Self::app_fetch_next(self.inner, self.state, false) Self::app_fetch_next(self.inner, self.state)
} }
} }

View File

@ -116,7 +116,7 @@ impl IAppInteractMatches for AppMachine<AppMatches> {
} }
fn select(self) -> Self::APP { fn select(self) -> Self::APP {
AppMachine::app_fetch_next(self.inner, self.state.fetch, false) AppMachine::app_fetch_next(self.inner, self.state.fetch)
} }
fn abort(self) -> Self::APP { fn abort(self) -> Self::APP {