Add todo
This commit is contained in:
parent
ac8ba06f4c
commit
1607a223cc
1 changed files with 17 additions and 0 deletions
17
src/tui.rs
17
src/tui.rs
|
@ -19,6 +19,21 @@ pub struct Tui {
|
||||||
tasks: SharedTasks,
|
tasks: SharedTasks,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn handle_signals(mut signals: Signals, channel: ) {
|
||||||
|
while let Some(signal) = signals.next().await {
|
||||||
|
match signal {
|
||||||
|
SIGHUP => {
|
||||||
|
// Reload configuration
|
||||||
|
// Reopen the log file
|
||||||
|
}
|
||||||
|
SIGTERM | SIGINT | SIGQUIT => {
|
||||||
|
// Shutdown the system;
|
||||||
|
},
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Tui {
|
impl Tui {
|
||||||
pub fn new(tasks: SharedTasks) -> Self {
|
pub fn new(tasks: SharedTasks) -> Self {
|
||||||
Self { tasks }
|
Self { tasks }
|
||||||
|
@ -36,6 +51,8 @@ impl Tui {
|
||||||
let mut signals = Signals::new(&[SIGHUP, SIGTERM, SIGINT, SIGQUIT])?;
|
let mut signals = Signals::new(&[SIGHUP, SIGTERM, SIGINT, SIGQUIT])?;
|
||||||
let handle = signals.handle();
|
let handle = signals.handle();
|
||||||
|
|
||||||
|
// TODO: enable isig to re-allow ctrl-z?
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
terminal.draw(|frame| {
|
terminal.draw(|frame| {
|
||||||
let area = frame.size();
|
let area = frame.size();
|
||||||
|
|
Loading…
Reference in a new issue