Revert "Convert telemetry into a model"

This reverts commit 6e4268a471.
This commit is contained in:
Joseph T. Lyons
2023-11-22 16:16:44 -05:00
parent c86e99928b
commit ee2b6834bd
9 changed files with 199 additions and 208 deletions
+16 -15
View File
@@ -10,6 +10,7 @@ pub use entity_map::*;
pub use model_context::*;
use refineable::Refineable;
use smallvec::SmallVec;
use smol::future::FutureExt;
#[cfg(any(test, feature = "test-support"))]
pub use test_context::*;
@@ -984,21 +985,21 @@ impl AppContext {
self.actions.all_action_names()
}
// pub fn on_app_quit<Fut>(
// &mut self,
// mut on_quit: impl FnMut(&mut AppContext) -> Fut + 'static,
// ) -> Subscription
// where
// Fut: 'static + Future<Output = ()>,
// {
// self.quit_observers.insert(
// (),
// Box::new(move |cx| {
// let future = on_quit(cx);
// async move { future.await }.boxed_local()
// }),
// )
// }
pub fn on_app_quit<Fut>(
&mut self,
mut on_quit: impl FnMut(&mut AppContext) -> Fut + 'static,
) -> Subscription
where
Fut: 'static + Future<Output = ()>,
{
self.quit_observers.insert(
(),
Box::new(move |cx| {
let future = on_quit(cx);
async move { future.await }.boxed_local()
}),
)
}
}
impl Context for AppContext {