Skip to main content

laminar_db/pipeline/
mod.rs

1//! Thread-per-core connector pipeline.
2//!
3//! Each source connector runs on a dedicated I/O thread with a
4//! single-threaded tokio runtime, pushing events through SPSC queues
5//! to CPU-pinned core threads. The `TpcPipelineCoordinator` drains
6//! core outboxes, runs SQL execution cycles, routes results to sinks,
7//! and manages checkpoint barriers.
8//!
9//! # Architecture
10//!
11//! ```text
12//! ┌──────────┐     ┌──────────┐     ┌──────────┐
13//! │ Source 0  │     │ Source 1  │     │ Source N  │   I/O threads
14//! │ (thread)  │     │ (thread)  │     │ (thread)  │
15//! └────┬─────┘     └────┬─────┘     └────┬─────┘
16//!      │ SPSC           │ SPSC           │ SPSC
17//!      ▼                ▼                ▼
18//! ┌──────────┐     ┌──────────┐     ┌──────────┐
19//! │  Core 0   │     │  Core 1   │     │  Core M   │   Pinned threads
20//! └────┬─────┘     └────┬─────┘     └────┬─────┘
21//!      │ SPSC           │ SPSC           │ SPSC
22//!      └───────┬────────┘────────────────┘
23//!              ▼
24//!     ┌─────────────────────┐
25//!     │ TpcPipelineCoordinator │  tokio task: SQL exec, sinks, checkpoints
26//!     └─────────────────────┘
27//! ```
28
29pub mod callback;
30pub mod config;
31pub mod source_adapter;
32pub mod tpc_coordinator;
33pub mod tpc_runtime;
34
35pub use callback::{PipelineCallback, SourceRegistration};
36pub use config::PipelineConfig;
37pub use tpc_coordinator::TpcPipelineCoordinator;
38pub use tpc_runtime::TpcRuntime;