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
//! Async Kafka client built on top of the tokio runtime.
//!
//! This crate provides lightweight asynchronous wrappers around the
//! synchronous APIs in `rustfs-kafka`. It exposes three primary types:
//!
//! - [`AsyncKafkaClient`]: bootstrap and connection management for async code.
//! - [`AsyncProducer`]: an async-friendly producer which runs a synchronous
//! `Producer` inside a background tokio task.
//! - [`AsyncConsumer`]: an async-friendly consumer which runs a synchronous
//! `Consumer` inside a dedicated background thread.
//!
//! These wrappers use MPSC/oneshot channels and join/abort semantics to bridge
//! between the synchronous core implementation and asynchronous callers.
//!
//! # Example
//!
//! ```no_run
//! use rustfs_kafka_async::{AsyncKafkaClient, AsyncProducer};
//! use rustfs_kafka::producer::Record;
//!
//! #[tokio::main]
//! async fn main() -> rustfs_kafka::error::Result<()> {
//! // Create an async client from bootstrap hosts
//! let client = AsyncKafkaClient::new(vec!["localhost:9092".to_owned()]).await?;
//! // Create an async producer which manages a background task
//! let mut producer = AsyncProducer::new(client).await?;
//!
//! // Send a single message and close the producer
//! producer.send(&Record::from_value("test-topic", &b"hello"[..])).await?;
//! producer.close().await?;
//! Ok(())
//! }
//! ```
pub use AsyncKafkaClient;
pub use AsyncConsumer;
pub use AsyncProducer;
// Re-export core types from the sync crate for convenience
pub use error;
pub use ;