cli: ensure ordering of rpc server messages (#183558)

* cli: ensure ordering of rpc server messages

Sending lots of messages to a stream would block them around the async
tokio mutex, which is "fair" so doesn't preserve ordering. Instead, use
the write_loop approach I introduced to the server_multiplexer for the
same reason some time ago.

* fix clippy
This commit is contained in:
Connor Peet
2023-05-26 09:48:06 -07:00
committed by GitHub
parent 6a7e91ebff
commit 1942c0eccc
3 changed files with 95 additions and 23 deletions

View File

@@ -4,11 +4,9 @@
*--------------------------------------------------------------------------------------------*/
use async_trait::async_trait;
use std::{marker::PhantomData, sync::Arc};
use tokio::{
sync::{
broadcast, mpsc,
watch::{self, error::RecvError},
},
use tokio::sync::{
broadcast, mpsc,
watch::{self, error::RecvError},
};
#[derive(Clone)]