Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
cloud_api_client: Move spawn native websocket to the background (#62874)
Remco Smits0f84a49e5193
diff --git a/crates/cloud_api_client/src/websocket/native.rs b/crates/cloud_api_client/src/websocket/native.rsindex d19da9f0027..dd6a2396dac 100644--- a/crates/cloud_api_client/src/websocket/native.rs+++ b/crates/cloud_api_client/src/websocket/native.rs@@ -5,7 +5,7 @@ use cloud_api_types::websocket_protocol::{PROTOCOL_VERSION, PROTOCOL_VERSION_HEAuse futures::channel::mpsc::unbounded;use futures::stream::{SplitSink, SplitStream};use futures::{FutureExt as _, SinkExt as _, StreamExt as _, TryStreamExt as _};-use gpui::{App, Task};+use gpui::{App, AppContext, Task};use http_client::http::request;use yawc::frame::Frame;use yawc::{TcpWebSocket, WebSocket};@@ -31,7 +31,7 @@ impl Connection {let rx = self.rx.fuse();let (message_tx, message_rx) = unbounded();let executor = cx.background_executor().clone();- let task = cx.spawn(async move |_cx| {+ let task = cx.background_spawn(async move {let keepalive_timer = executor.timer(KEEPALIVE_INTERVAL).fuse();futures::pin_mut!(keepalive_timer, rx);