Skip to main content

Crate vixitic

Crate vixitic 

Source
Expand description

Vixitic — a deterministic tick-reactor async runtime.

async in Rust is a compiler state machine plus a Waker contract: “am I done? no? call this when I should re-check.” Tokio answers “who calls the waker” with an OS reactor (epoll/IOCP). Vixitic answers it with your integer clock: a task wakes on the exact tick your simulation says it should, never on a socket, a thread scheduler, or a wall clock.

That makes every resume a pure function of (condition, event schedule), which is what lockstep netcode, rollback, emulators and replayable simulations actually need. Two runs of the same schedule produce a byte-identical resume log — see tests/integration.rs.

Two primitives, nothing else:

use vixitic::{sleep_ticks, spawn, Runtime};

let rt = Runtime::new();
let woke = rt.block_on(
    async {
        spawn(async { sleep_ticks(3).await; });
        sleep_ticks(5).await
    },
    |_tick| Vec::new(), // no external events this run
    10,                 // hang-guard: panic rather than spin forever
);
assert_eq!(woke, 5);

Zero dependencies, std only.

Structs§

Await
The future returned by await_event / sleep_ticks. Resolves to the tick it was woken on.
Reactor
Binds wakers to integer clock events. Single-writer, driven by your engine.
Runtime
The Vixio runtime: drain the run-queue, advance the integer clock, repeat.

Enums§

Cond
What a parked task is waiting for.

Functions§

await_event
Park until the engine fires event id. Resumes on the exact integer tick the engine reported it.
sleep_ticks
Park for n ticks of the integer clock, relative to now.
spawn
Spawn a child task onto the current runtime. Fire-and-forget: the handle is not returned, so a child that outlives the root is simply dropped.