Expand description
Background commit timer and synchronous commit helpers.
Due to SQLite’s threading constraints (rusqlite::Connection is not Sync), we use a timer-based approach where:
- A background thread tracks elapsed time
- When commit time arrives, it sets a flag
- The actual commit is performed synchronously by the caller
This module provides:
CommitTimer- Background timer that signals when commits are duecommit_now- Synchronous commit helperCommitConfig- Configuration for commit behavior
Structs§
- Commit
Config - Commit worker configuration
- Commit
Timer - A timer that signals when commits are due.
Constants§
- DEFAULT_
COMMIT_ INTERVAL - Default commit interval (1 minute)
- MIN_
COMMIT_ INTERVAL - Minimum commit interval
Functions§
- commit_
now - Synchronous commit helper (for forced commits from main thread)
- force_
commit_ sync - Force a commit and wait for completion
Type Aliases§
- Commit
Worker - Legacy CommitWorker type alias for backwards compatibility