Skip to content

Commit 0cfa18c

Browse files
authored
Merge pull request #3 from runtimed/tokio-reactor
initialize GPUI tokio reactor and spawn on it
2 parents be3f93f + d1bd928 commit 0cfa18c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
gpui = { git = "https://github.com/zed-industries/zed" }
8+
gpui_tokio = { git = "https://github.com/zed-industries/zed" }
89
http_client = { git = "https://github.com/zed-industries/zed" }
910
reqwest_client = { git = "https://github.com/zed-industries/zed" }
1011
anyhow = "1"

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use mybinder::parse_binder_build_response;
1313
use reqwest_client::ReqwestClient;
1414

1515
fn app_main(cx: &mut App) {
16+
gpui_tokio::init(cx);
17+
1618
let http_client = Arc::new(
1719
ReqwestClient::proxy_and_user_agent(None, "github.com/runtimed/smoke")
1820
.expect("could not start HTTP client"),
@@ -164,7 +166,11 @@ fn app_main(cx: &mut App) {
164166

165167
println!("{}", "🌽 Kernel launched".bright_yellow());
166168

167-
let (ws, _ws_response) = remote_server.connect_to_kernel(&kernel_id).await?;
169+
let ws = gpui_tokio::Tokio::spawn(cx, async move {
170+
let (ws, _ws_response) = remote_server.connect_to_kernel(&kernel_id).await?;
171+
anyhow::Ok(ws)
172+
})?
173+
.await??;
168174

169175
let (mut w, mut r) = ws.split();
170176

0 commit comments

Comments
 (0)