Add weather data to cockpit
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Isaac Mills 2025-07-28 17:43:41 -06:00
parent 265f8d8dc3
commit 450183c06b
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
5 changed files with 419 additions and 70 deletions

View file

@ -1,4 +1,4 @@
use std::{future::Future, time::Duration};
use std::{cell::OnceCell, future::Future, rc::Rc, time::Duration};
use futures_util::FutureExt;
use ratatui::crossterm::event;
@ -10,9 +10,9 @@ impl AppExecutor for TokioExecutor {
fn execute<T: 'static>(
&self,
future: impl Future<Output = T> + 'static,
sender: std::sync::mpsc::Sender<T>,
output_cell: Rc<OnceCell<T>>,
) {
tokio::task::spawn_local(future.map(move |output| sender.send(output).unwrap()));
tokio::task::spawn_local(future.map(move |output| output_cell.set(output)));
}
}