buckethead.core¶
The BucketSQLite orchestrator. One class, the public entry point.
buckethead.core
¶
BucketSQLite: the public orchestrator class.
Wires together everything from earlier phases
- BucketClient (Phase 3)
- snapshot.flush / snapshot.restore (Phase 4)
- FlushLoop, install_signal_handlers, install_atexit (Phase 5)
- FileStore (Phase 10)
Owns the keep-alive connection (shared-cache URI per the Phase 0 decision) and coordinates lifecycle so callers only see start() / stop() / flush() / force_flush() / connect() / connection / files.
BucketSQLite
¶
BucketSQLite(
bucket_config: BucketConfig | None = None,
snapshot_config: SnapshotConfig | None = None,
profiling_config: ProfilingConfig | None = None,
*,
on_flush_start: Callable[[], None] | None = None,
on_flush_complete: Callable[[float, int], None]
| None = None,
on_flush_error: Callable[[BaseException], None]
| None = None,
status_reporter: StatusReporter | None = None,
share_config: ShareConfig | None = None,
project: str | None = None,
)
Source code in src/buckethead/core.py
shares
property
¶
shares: SharingService
File-sharing API. Requires a share_config at construction.
Raises RuntimeError when sharing isn't configured — keeps the "sharing off" case from looking like a typo in the caller.
connect
¶
Open a new connection to the shared in-memory DB.
Intended use: one per thread. Closing any vended connection does not tear down the DB — the keep-alive connection owned by BucketSQLite keeps it alive until stop().
Source code in src/buckethead/core.py
flush
¶
Debounced manual flush.
No-op if less than snapshot_config.min_interval_seconds has passed
since the last successful flush of any kind.