What problem does it solve?
Turso's asynchronous I/O model uses cooperative yielding and explicit state machines to manage I/O-bound tasks without Rust's async/await, reducing re-entrancy bugs and making IO progress deterministic.
Core Features & Use Cases
- IOResult and IOCompletions as the primitive for non-blocking operations.
- CompletionGroup to aggregate multiple IOs into a single completion with cancellation support.
- return_if_io! and io_yield_one! macros to manage yields and resumes safely.
- State-machine driven operation patterns to prevent re-entry bugs across core storage and IO layers (btree, pager, and utilities).
- Re-entrancy hazard awareness and best practices for mutating state only after IO completion.
Quick Start
To get started, study the Core Types, Completion structures, and State Machine patterns described above, then implement a tiny operation that yields once and resumes to completion. You can adapt this to a simple read workflow in core/storage/btree.rs or core/storage/pager.rs to see the patterns in action.