use std::collections::HashSet;
use crate::schema::CheckMode;
pub(crate) type ControlEventReceiver = tokio::sync::mpsc::Receiver<ControlEvent>;
pub(crate) type ControlEventSender = tokio::sync::mpsc::Sender<ControlEvent>;
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum RunEventInner {
Unspecified {
redo_inconsistent_tasks: bool,
},
Fresh,
Rebuild {
skip: HashSet<String>,
redo_inconsistent_tasks: bool,
},
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) enum ControlEvent {
Check {
mode: CheckMode,
},
Run(RunEventInner),
Pause {
targets: Vec<String>,
cascade: bool,
},
Resume {
targets: Vec<String>,
},
Quit {
force: bool,
no_exit: bool,
},
Exit,
}
impl ControlEvent {
pub(crate) const FRESH_RUN: Self = Self::Run(RunEventInner::Fresh);
pub(crate) const FORCE_QUIT: Self = Self::Quit {
force: true,
no_exit: false,
};
}