async-io-model

Official

Cooperative IO patterns for Turso apps.

Authortursodatabase
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: async-io-model
Download link: https://github.com/tursodatabase/turso/archive/main.zip#async-io-model

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.