Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Async, Concurrency, and Offline Progress

Atuin’s CLI uses a current-thread Tokio runtime; the server uses a multi-thread runtime. Network requests and SQLx operations suspend cooperatively, while packing, unpacking, encryption-heavy blob work, and other synchronous CPU paths cross spawn_blocking.

The V2 sync loop explicitly says its operations could run in parallel but currently executes them sequentially. Ordering makes packfile expansion, per-host tails, progress, error attribution, and SQLite mutation easier to reason about. Async does not require maximizing concurrency.

SQLite uses WAL mode and pools for ordinary operations. Transactions group domain writes that must become visible together. The optional daemon introduces a broadcast event bus: history capture, sync, search indices, settings, and shutdown react through owned component tasks rather than sharing one mutable application object.

Concurrency boundaries follow consequences: hot shell hooks avoid database initialization for latency; sync pages bound network/memory work; background search loaders may be replaced; projection rebuild errors are contained. The system remains locally functional when network sync is slow or absent.