changed name and make send_to public

This commit is contained in:
Nickiel12 2024-08-20 17:32:44 -07:00
parent e9b4bfee32
commit 7a438997ad

View file

@ -67,11 +67,11 @@ pub async fn connect_to_server(
let moved_copy = receiver_is_closed.clone(); let moved_copy = receiver_is_closed.clone();
tokio::spawn(async move { tokio::spawn(async move {
listen_to_ws(to_app, moved_copy, ws_recv) listen_to_ws_task(to_app, moved_copy, ws_recv)
}); });
tokio::spawn(async move { tokio::spawn(async move {
send_to_wc(to_core_reciever, receiver_is_closed, ws_sender) send_to_wc_task(to_core_reciever, receiver_is_closed, ws_sender)
}); });
info!("Websocket connect successfully"); info!("Websocket connect successfully");
@ -80,7 +80,7 @@ pub async fn connect_to_server(
} }
#[instrument(skip_all)] #[instrument(skip_all)]
async fn send_to_wc( pub async fn send_to_wc_task(
from_app: AppReceiver, from_app: AppReceiver,
is_closed: Arc<AtomicBool>, is_closed: Arc<AtomicBool>,
mut sender: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, tokio_tungstenite::tungstenite::Message> mut sender: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, tokio_tungstenite::tungstenite::Message>
@ -123,7 +123,7 @@ async fn send_to_wc(
#[instrument(skip_all)] #[instrument(skip_all)]
async fn listen_to_ws( pub async fn listen_to_ws_task(
to_app: AppSender, to_app: AppSender,
is_closed: Arc<AtomicBool>, is_closed: Arc<AtomicBool>,
mut reader: SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>> mut reader: SplitStream<WebSocketStream<MaybeTlsStream<TcpStream>>>