Expand description
Per-camp Turso store for TaskRun bytes (Tier 1).
One TaskStore per daemon instance; callers share it via Arc<TaskStore>.
Backed by turso (in-process, async) per W195 §Engine. Concurrency model:
each TaskStore method gets a fresh turso::Connection from the shared
Database and drops it at the end of the call. A single Connection
cannot be used concurrently in turso 0.6.x — the SDK’s ConcurrentGuard
returns Misuse("concurrent use forbidden") rather than serializing —
so we don’t share one across the reader thread, the tail-poll loop, and
the GC sweep. Database::connect() is cheap (an Arc clone plus a
per-connection state struct).
Independent connections mean independent write-lock contenders, so every
connection carries a busy_timeout and every write goes through
TaskStore::exec_retry, which retries the Busy class with backoff. A
write that returns Busy is a lost write, not a slow one — R617-B9 was
exactly that: the lifecycle’s terminal update_status losing the race
against chunk/event writers and leaving the run Running forever.
Storage contract (W195 §3 / Shape 1): this store owns
.yah/db/task-runs.turso under the camp daemon.
Structs§
- Aggregate
Bucket - Aggregate
Filter - Chunk
Filter - Event
Filter - Field
Filter - Field
Index Info - GcConfig
- GcResult
- RunFilter
- Task
Store