kithara-platform 0.0.1-alpha2

Cross-platform primitives (sync, time, thread) for native and wasm32.
Documentation

crates.io docs.rs License

kithara-platform

Platform-aware runtime primitives for native and wasm32 targets. This crate is the portability boundary for synchronization, thread/task spawning, timing helpers, and conditional trait bounds used across the workspace.

Usage

use kithara_platform::{Mutex, time};

let lock = Mutex::new(42_u32);
{
    let mut guard = lock.lock_sync();
    *guard += 1;
}

time::sleep(std::time::Duration::from_millis(10)).await;

Synchronization Backends

Thread and Task Primitives

Time Utilities

  • time::sleep(duration)
  • time::timeout(duration, future)
  • time::Instant (via web-time)

On native these delegate to tokio runtime primitives, on wasm they use setTimeout-based scheduling.

Integration

Foundation crate used across the workspace (kithara-storage, kithara-assets, kithara-stream, kithara-play, kithara-wasm, and test infrastructure) to keep platform-specific branching isolated in one place.