Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Dec 4, 2023
1 parent 248210d commit 3fa412b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ fn start_rpc_thread(mut receiver: mpsc::Receiver<ReqImpl>) -> Result<()> {
let mut stdin = process.stdin.unwrap();
let mut pending_requests: HashMap<jsonrpc_core::Id, oneshot::Sender<Result<serde_json::value::Value>>> =
HashMap::new();
let mut last_pending_request_id: Option<jsonrpc_core::Id> = None;

loop {
tokio::select! {
Expand Down Expand Up @@ -226,6 +227,8 @@ fn start_rpc_thread(mut receiver: mpsc::Receiver<ReqImpl>) -> Result<()> {
}
Some((request, response_sender)) => {
pending_requests.insert(request.id.clone(), response_sender);
last_pending_request_id = Some(request.id.clone());

let mut req = serde_json::to_vec(&request).unwrap();
req.push(b'\n');
stdin.write_all(&req).await.unwrap();
Expand Down

0 comments on commit 3fa412b

Please sign in to comment.