Skip to main content

Crate kwokka

Crate kwokka 

Source
Expand description

Completion-based async runtime with optional orchestration.

This crate is the sole user entry point: every item re-exported here is the supported surface over the workspace crates, and nothing outside it is a stability promise. The runtime is scheduler-explicit by design – construct runtime::Runtime::affine for a pinned thread-per-core worker or runtime::Runtime::stealing for a work-stealing crew; there is no default scheduler.

Tasks fan out through structured scopes (task::scope and the Send-bounded task::scope_send) rather than a free-standing spawn, so every child settles before its scope resolves. time::sleep suspends a task for a wall-clock duration.

Network and filesystem endpoints live under the net and fs modules, each gated behind its own feature (net, fs, or full) so a minimal build pulls in neither. Every runtime task carries a tree-structured identity for tracing, but the runtime does not hand it back yet.

§Examples

let mut runtime = kwokka::runtime::Runtime::affine()?;
let value = runtime.block_on(async { 41 + 1 });
assert_eq!(value, 42);

Modules§

fs
Filesystem endpoints – files over the completion backend.
net
Network endpoints – TCP sockets over the completion backend.
runtime
Runtime entry points – scheduler-explicit construction and blocking execution.
task
Task surface – structured scopes, scheduler markers, and yielding.
time
Time-driven task utilities – wall-clock sleeping.

Attribute Macros§

main
The async entry-point attribute.