gpui-tokio-bridge 0.1.0

Tokio bridge for GPUI - allows running tokio async tasks within GPUI context
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 189.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.61 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2m 7s Average build duration of successful builds.
  • all releases: 2m 7s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • AprilNEA/gpui-tokio-bridge
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AprilNEA

gpui-tokio-bridge

Tokio bridge for GPUI - allows running tokio async tasks within GPUI context.

Usage

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();
    }
}

Credits

Based on gpui_tokio from Zed Industries.

License

Apache-2.0