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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//! # lnc-client
//!
//! Async Rust client library for the [LANCE](https://github.com/nitecon/lance) streaming platform.
//!
//! LANCE is a high-performance, non-blocking stream engine designed for 100Gbps sustained
//! ingestion with sub-microsecond P99 latency.
//!
//! ## Features
//!
//! - **Async/await** - Built on Tokio for high-performance async I/O
//! - **Producer** - Batch records with configurable batching and backpressure
//! - **Consumer** - Standalone ([`standalone`]) and grouped ([`grouped`]) consumer modes
//! - **Connection pooling** - Automatic reconnection and cluster-aware routing
//! - **TLS support** - Secure connections with rustls
//! - **Zero-copy** - Efficient record parsing with minimal allocations
//!
//! ## Quick Start
//!
//! ### Producer
//!
//! ```rust,no_run
//! use lnc_client::{Producer, ProducerConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let producer = Producer::connect("127.0.0.1:1992", ProducerConfig::new()).await?;
//!
//! producer.send(1, b"Hello, LANCE!").await?;
//! producer.flush().await?;
//! producer.close().await?;
//!
//! Ok(())
//! }
//! ```
//!
//! ### Consumer (Standalone)
//!
//! For independent consumption with manual offset control:
//!
//! ```rust,no_run
//! use lnc_client::{StandaloneConsumer, StandaloneConfig};
//! use std::path::Path;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut consumer = StandaloneConsumer::connect(
//! "127.0.0.1:1992",
//! StandaloneConfig::new("my-consumer", 1)
//! .with_offset_dir(Path::new("/var/lib/lance/offsets")),
//! ).await?;
//!
//! loop {
//! if let Some(records) = consumer.next_batch().await? {
//! // Process records
//! for chunk in records.data.chunks(256) {
//! println!("Received {} bytes", chunk.len());
//! }
//! consumer.commit().await?;
//! }
//! }
//! }
//! ```
//!
//! ### Consumer (Grouped)
//!
//! ```rust,no_run
//! use lnc_client::{AssignmentStrategy, GroupCoordinator, GroupConfig, GroupedConsumer, WorkerConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Start coordinator (typically one per consumer group)
//! let coordinator = GroupCoordinator::start(
//! "127.0.0.1:1992",
//! GroupConfig::new("my-group")
//! .with_topics(vec![1, 2, 3])
//! .with_assignment_strategy(AssignmentStrategy::RoundRobin),
//! ).await?;
//!
//! // Workers join the group
//! let mut worker = GroupedConsumer::join(
//! "127.0.0.1:1992",
//! coordinator.join_address(),
//! WorkerConfig::new("worker-1"),
//! ).await?;
//!
//! // Worker processes assigned topics
//! loop {
//! let topics: Vec<u32> = worker.assignments().to_vec();
//! for topic_id in topics {
//! if let Some(_records) = worker.next_batch(topic_id).await? {
//! worker.commit(topic_id).await?;
//! }
//! }
//! }
//! }
//! ```
//!
//! ## Modules
//!
//! - [`producer`] - High-level producer with batching and async send
//! - [`standalone`] - Standalone consumer for direct offset control
//! - [`grouped`] - Grouped consumer with automatic partition assignment
//! - [`connection`] - Connection pooling and cluster-aware routing
//! - [`offset`] - Offset storage backends (memory, file-based)
//! - [`record`] - Record encoding/decoding utilities
//! - [`tls`] - TLS configuration
//!
//! ## Platform Support
//!
//! The client library supports all major platforms:
//! - Linux (x86_64, aarch64)
//! - macOS (x86_64, aarch64)
//! - Windows (x86_64)
//!
//! > **Note**: The LANCE server requires Linux with io_uring support, but the client works everywhere.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use TlsClientConfig;