| Crates.io | gpui-tokio-bridge |
| lib.rs | gpui-tokio-bridge |
| version | 0.1.0 |
| created_at | 2026-01-18 11:14:26.20526+00 |
| updated_at | 2026-01-18 11:14:26.20526+00 |
| description | Tokio bridge for GPUI - allows running tokio async tasks within GPUI context |
| homepage | |
| repository | https://github.com/AprilNEA/gpui-tokio-bridge |
| max_upload_size | |
| id | 2052211 |
| size | 190,005 |
Tokio bridge for GPUI - allows running tokio async tasks within GPUI context.
use gpui_tokio_bridge::{init, Tokio};
// Initialize in your app setup
fn main() {
gpui::Application::new().run(|cx| {
init(cx);
// ...
});
}
// Spawn tokio tasks from GPUI context
impl MyComponent {
fn fetch_data(&mut self, cx: &mut Context<Self>) {
Tokio::spawn(cx, async {
// Your async code here
reqwest::get("https://api.example.com").await
})
.detach();
}
}
Based on gpui_tokio from Zed Industries.
Apache-2.0