Skip to content

Commit

Permalink
misc: small fix or general refactoring i did not bother commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Jun 28, 2024
1 parent 5761b01 commit 7b24489
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use clap::Parser;

mod agent;
mod cli;
mod listener;
mod setup;
mod ui;

const APP_NAME: &str = env!("CARGO_BIN_NAME");
const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
Expand Down Expand Up @@ -37,8 +37,8 @@ async fn main() -> Result<()> {

let (mut agent, events_rx) = setup::setup_agent(&args).await?;

// spawn the events listener
tokio::spawn(listener::events_listener(args, events_rx));
// spawn the events consumer
tokio::spawn(ui::text::consume_events(args, events_rx));

// keep going until the task is complete or a fatal error is reached
while !agent.is_done().await {
Expand Down
1 change: 1 addition & 0 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub(crate) mod text;
2 changes: 1 addition & 1 deletion src/listener.rs → src/ui/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
cli,
};

pub(crate) async fn events_listener(args: cli::Args, mut events_rx: Receiver) {
pub(crate) async fn consume_events(args: cli::Args, mut events_rx: Receiver) {
while let Some(event) = events_rx.recv().await {
match event {
Event::MetricsUpdate(metrics) => {
Expand Down

0 comments on commit 7b24489

Please sign in to comment.