Going back to blocking, need a new thread here
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
use async_trait::async_trait;
|
||||
use bft_json_crdt::json_crdt::SignedOp;
|
||||
use ezsockets::ClientConfig;
|
||||
use tokio::fs::File;
|
||||
use tokio::io;
|
||||
use std::io::BufRead;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::{node::SideNode, utils};
|
||||
@@ -25,11 +24,10 @@ impl WebSocketClient {
|
||||
tokio::spawn(async move {
|
||||
future.await.unwrap();
|
||||
});
|
||||
let stdin = tokio::io::stdin();
|
||||
// let lines = stdin.lock().lines();
|
||||
//
|
||||
let mut reader = FramedRead::new(stdin, LinesCodec::new());
|
||||
let line = reader.next().await.transpose()?.unwrap();
|
||||
let stdin = std::io::stdin();
|
||||
let lines = stdin.lock().lines();
|
||||
for line in lines {
|
||||
let line = line.unwrap();
|
||||
let signed_op = if let "exit" = line.as_str() {
|
||||
break;
|
||||
} else if let "trace" = line.as_str() {
|
||||
@@ -44,6 +42,7 @@ impl WebSocketClient {
|
||||
handle.text(json).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl ezsockets::ClientExt for WebSocketClient {
|
||||
|
||||
Reference in New Issue
Block a user