Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita committed Mar 17, 2021
1 parent 528ff15 commit 690b755
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/agent/onefuzz-agent/src/local/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@ impl TerminalUi {
loop {
if event::poll(Duration::from_secs(0))? {
let event = event::read()?;
ui_event_tx
.send(TerminalEvent::Input(event))?;
ui_event_tx.send(TerminalEvent::Input(event))?;
} else {
ui_event_tx
.send(TerminalEvent::Tick)?;
ui_event_tx.send(TerminalEvent::Tick)?;
interval.tick().await;
}
}
Expand Down Expand Up @@ -325,15 +323,22 @@ impl TerminalUi {

let (ui_event_tx, ui_event_rx) = mpsc::unbounded_channel();
let ui_event_tx_clone = ui_event_tx.clone();
let ui_event_handle = tokio::spawn(async { Self::read_ui_events(ui_event_tx_clone).await.context("reading Events")? ; Ok(()) });
let ui_event_handle = tokio::spawn(async {
Self::read_ui_events(ui_event_tx_clone)
.await
.context("reading Events")?;
Ok(())
});

let task_event_receiver = self.task_event_receiver;
let external_event_handle =
tokio::spawn(Self::read_commands(ui_event_tx, task_event_receiver));
terminal.clear()?;
let initial_state = UILoopState::new(terminal, self.log_event_receiver);
let ui_loop = tokio::spawn(Self::ui_loop(initial_state, ui_event_rx));
try_wait_all_join_handles(vec![ui_event_handle, ui_loop, external_event_handle]).await.context("***** run handle")
try_wait_all_join_handles(vec![ui_event_handle, ui_loop, external_event_handle])
.await
.context("***** run handle")
}
}

Expand Down

0 comments on commit 690b755

Please sign in to comment.