kithara-platform 0.0.1-alpha2

Cross-platform primitives (sync, time, thread) for native and wasm32.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Platform-aware async task spawning.
//!
//! On native: delegates to real `tokio::task`.
//! On WASM: custom dispatch — main thread vs Web Worker.
//!
//! Baseline re-exported from `tokio_with_wasm::alias::task` (provides `yield_now`,
//! `JoinHandle`, `JoinError`, etc.). On WASM, `spawn` and `spawn_blocking` are
//! overridden with Worker-lifecycle-aware versions.

pub use tokio_alias::task::*;
use tokio_with_wasm::alias as tokio_alias;

#[cfg(target_arch = "wasm32")]
mod wasm;
#[cfg(target_arch = "wasm32")]
pub use wasm::{JoinError, JoinHandle, spawn, spawn_blocking};