Skip to main content

eventuary_sqlite/
coordinated_reader.rs

1//! SQLite coordinated reader: thin alias over the generic core type.
2//!
3//! Why this file is alias-only:
4//!
5//! `CoordinatedReader<R, Coord>` is fully generic in `eventuary-core` — it
6//! composes any partition-aware `Reader<R>` with any `PartitionCoordinator<C>`
7//! and contains no SQLite-specific code. Every backend therefore only needs
8//! `pub type` aliases to specialize the generic with its own reader and
9//! coordinator (`SqliteReader` + `SqlitePartitionCoordinator`). The same
10//! module path shape (`eventuary::sqlite::coordinated_reader::*`) is
11//! preserved across backends so users learn one structure once.
12//!
13//! These aliases shorten call sites — `SqliteCoordinatedReader` reads better
14//! than `CoordinatedReader<SqliteReader, SqlitePartitionCoordinator>` — and
15//! give the umbrella a canonical, discoverable path next to `reader`,
16//! `writer`, and `partition_coordinator` modules.
17
18use eventuary_core::io::reader::{
19    CoordinatedAcker, CoordinatedCursor, CoordinatedReader, CoordinatedReaderConfig,
20    CoordinatedStream, CoordinatedSubscription,
21};
22
23use crate::partition_coordinator::SqlitePartitionCoordinator;
24use crate::reader::{SqliteCursor, SqliteCursorAcker, SqliteReader, SqliteSubscription};
25
26pub type SqliteCoordinatedReaderConfig = CoordinatedReaderConfig;
27pub type SqliteCoordinatedSubscription = CoordinatedSubscription<SqliteSubscription, SqliteCursor>;
28pub type SqliteCoordinatedReader = CoordinatedReader<SqliteReader, SqlitePartitionCoordinator>;
29pub type SqliteCoordinatedAcker =
30    CoordinatedAcker<SqliteCursorAcker, SqliteCursor, SqlitePartitionCoordinator>;
31pub type SqliteCoordinatedCursor = CoordinatedCursor<SqliteCursor>;
32pub type SqliteCoordinatedStream =
33    CoordinatedStream<SqliteCursorAcker, SqliteCursor, SqlitePartitionCoordinator>;