Reduce cpu usage and fix network monitor

This commit is contained in:
ranfdev
2023-11-07 19:57:54 +01:00
parent ae2084c74a
commit 5c518322be
8 changed files with 68 additions and 28 deletions

View File

@ -1,6 +1,8 @@
use std::collections::HashMap;
use std::pin::Pin;
use std::sync::OnceLock;
use futures::stream::Stream;
use regex::Regex;
use serde::{Deserialize, Serialize};
@ -316,3 +318,7 @@ pub struct Notification {
pub trait NotificationProxy: Sync + Send {
fn send(&self, n: Notification) -> anyhow::Result<()>;
}
pub trait NetworkMonitorProxy: Sync + Send {
fn listen(&self) -> Pin<Box<dyn Stream<Item = ()>>>;
}