SqlDelightEventStore

class SqlDelightEventStore(database: KmpWorkerDatabase) : EventStore

SQLDelight-backed EventStore that persists terminal task events to SQLite.

All events are written atomically. On cold launch, call replayAll once at startup (before the UI renders) to re-emit any events missed while the app was terminated.

Thread-safety: All operations are dispatched to Dispatchers.IO.

Auto-pruning: Events are kept for 7 days after replay by default. Call prune periodically (e.g., on app start after replay) to keep storage bounded.

Constructors

Link copied to clipboard
constructor(database: KmpWorkerDatabase)

Functions

Link copied to clipboard
open suspend override fun clear(taskId: String)
Link copied to clipboard
open suspend override fun prune(olderThanMillis: Long)
Link copied to clipboard
open suspend override fun record(taskId: String, state: TaskState)
Link copied to clipboard
open suspend override fun replayAll(emit: suspend (taskId: String, state: TaskState) -> Unit)