Skip to content

Commit

Permalink
Rename server to EVTBuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
Reboot-Codes committed Sep 1, 2024
1 parent ff21332 commit d249f8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion clover-hub/src/server/evtbuzz/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub struct ServerHealth {
up_since: String
}

pub async fn server_listener(port: u16, ipc_tx: UnboundedSender<IPCMessageWithId>, mut ipc_rx: UnboundedReceiver<IPCMessageWithId>, store: Arc<Store>) {
pub async fn evtbuzz_listener(port: u16, ipc_tx: UnboundedSender<IPCMessageWithId>, mut ipc_rx: UnboundedReceiver<IPCMessageWithId>, store: Arc<Store>) {
info!("Starting HTTP and WebSocket Server on port: {}...", port);

let clients_tx: Arc<Mutex<HashMap<String, UnboundedSender<IPCMessageWithId>>>> = Arc::new(Mutex::new(HashMap::new()));
Expand Down
20 changes: 10 additions & 10 deletions clover-hub/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use log::{debug, error, info};
use evtbuzz::models::Store;
use uuid::Uuid;
use evtbuzz::models::IPCMessageWithId;
use evtbuzz::listener::server_listener;
use evtbuzz::listener::evtbuzz_listener;
use arbiter::arbiter_main;
use renderer::renderer_main;
use modman::modman_main;
Expand All @@ -36,18 +36,18 @@ pub async fn server_main(port: u16) {

// Start EVTBuzz
// TODO: Rename to EVTBuzz
let (listener_from_tx, mut listener_from_rx) = mpsc::unbounded_channel::<IPCMessageWithId>();
let (listener_to_tx, listener_to_rx) = mpsc::unbounded_channel::<IPCMessageWithId>();
let listener_port = Arc::new(port);
let listener_store = Arc::new(store.clone());
let listener_handler = tokio::task::spawn(async move {
server_listener(*listener_port.to_owned(), listener_from_tx, listener_to_rx, listener_store.clone()).await;
let (evtbuzz_from_tx, mut evtbuzz_from_rx) = mpsc::unbounded_channel::<IPCMessageWithId>();
let (evtbuzz_to_tx, evtbuzz_to_rx) = mpsc::unbounded_channel::<IPCMessageWithId>();
let evtbuzz_port = Arc::new(port);
let evtbuzz_store = Arc::new(store.clone());
let evtbuzz_handler = tokio::task::spawn(async move {
evtbuzz_listener(*evtbuzz_port.to_owned(), evtbuzz_from_tx, evtbuzz_to_rx, evtbuzz_store.clone()).await;
});

let ipc_from_listener_dispatch = tokio::task::spawn(async move {
while let Some(msg) = listener_from_rx.recv().await {
while let Some(msg) = evtbuzz_from_rx.recv().await {
// TODO: Add all IPC channels to this list.
handle_ipc_send(&listener_to_tx, msg, "clover::server::listener".to_string());
handle_ipc_send(&evtbuzz_to_tx, msg, "clover::server::listener".to_string());
}
});

Expand Down Expand Up @@ -77,7 +77,7 @@ pub async fn server_main(port: u16) {
});

futures::future::join_all(vec![
listener_handler,
evtbuzz_handler,
ipc_from_listener_dispatch,
arbiter_handler,
renderer_handler,
Expand Down

0 comments on commit d249f8d

Please sign in to comment.