use std::sync::Arc;
use sculk::persist::Profile;
use sculk::tunnel::IrohTunnel;
use tokio::sync::mpsc;
use tokio::task::JoinHandle;
use crate::services::tunnel::AppEvent;
pub(crate) struct AppContext {
pub(crate) app_tx: mpsc::UnboundedSender<AppEvent>,
pub(crate) profile: Profile,
pub(crate) tunnel: Option<Arc<IrohTunnel>>,
pub(crate) event_forwarder: Option<JoinHandle<()>>,
pub(crate) startup_handle: Option<JoinHandle<()>>,
}
impl AppContext {
pub(crate) fn new(app_tx: mpsc::UnboundedSender<AppEvent>, profile: Profile) -> Self {
Self {
app_tx,
profile,
tunnel: None,
event_forwarder: None,
startup_handle: None,
}
}
}