1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: BUSL-1.1
//! # nodedb-bridge
//!
//! Lock-free, capacity-bounded SPSC ring buffer bridging a **Tokio Control Plane**
//! (`Send + Sync`) and a **Thread-per-Core Data Plane** (`!Send`).
//!
//! This crate is the single most critical infrastructure component in NodeDB.
//! If this bridge fails under load, the entire database fails.
//!
//! ## Design constraints
//!
//! - **No locks, no atomics in the hot path** beyond the two cache-line-padded
//! head/tail counters (one written by producer, one by consumer).
//! - **Bounded capacity**: the ring buffer has a fixed power-of-two slot count.
//! When full, the producer must yield — this is the backpressure mechanism.
//! - **Cross-runtime waker integration**: when the queue transitions from
//! full→not-full or empty→not-empty, the sleeping side must be woken
//! *without* requiring `Send` on the waker itself.
//! - **Zero-copy where possible**: payloads are `Arc<[u8]>` or slab handles;
//! the ring buffer moves lightweight envelopes, not bulk data.
//!
//! ## Validation target
//!
//! Pump 50 GB of dummy data Tokio→TPC→Tokio. Memory must stay flat.
//! Throughput must exceed 5 GB/s on a modern x86_64 machine.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use BridgeMetrics;
pub use AsyncControlHandle;