| 1 |
use crate::config::Config; |
| 2 |
use crate::domain::{AppId, Target}; |
| 3 |
use crate::events::EventTx; |
| 4 |
use crate::ota::OtaRegistry; |
| 5 |
use crate::topology::Topology; |
| 6 |
use metrics_exporter_prometheus::PrometheusHandle; |
| 7 |
use sqlx::SqlitePool; |
| 8 |
use std::collections::HashMap; |
| 9 |
use std::sync::Arc; |
| 10 |
use tokio::sync::Mutex; |
| 11 |
use tokio::task::AbortHandle; |
| 12 |
|
| 13 |
#[derive(Clone)] |
| 14 |
pub struct AppState { |
| 15 |
pub pool: SqlitePool, |
| 16 |
pub topo: Arc<Topology>, |
| 17 |
pub cfg: Arc<Config>, |
| 18 |
pub prom: PrometheusHandle, |
| 19 |
pub events: EventTx, |
| 20 |
pub ota: Arc<OtaRegistry>, |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
pub active: Arc<Mutex<HashMap<(AppId, Target), AbortHandle>>>, |
| 25 |
} |
| 26 |
|