Allow peers to receive individual messages before starting message loop

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-06-17 14:19:15 -07:00
co-authored by Nathan Sobo
parent 4d28d03e3f
commit 05a662b35e
2 changed files with 75 additions and 47 deletions
+2 -2
View File
@@ -691,8 +691,8 @@ impl Workspace {
// a TLS stream using `native-tls`.
let stream = smol::net::TcpStream::connect(rpc_address).await?;
let (connection_id, handler) = rpc.add_connection(stream).await;
executor.spawn(handler).detach();
let connection_id = rpc.add_connection(stream).await;
executor.spawn(rpc.handle_messages(connection_id)).detach();
let auth_response = rpc
.request(