Integrate rust-rdkafka with Tokio or other runtimes
masterThe high-level clients (StreamConsumer and FutureProducer) are designed to work seamlessly with the Tokio runtime.
Using Tokio
Tokio integration is enabled by default. You can use these clients to write asynchronous message processing code within the Tokio ecosystem.
Using other runtimes (smol, async-std)
If you want to avoid the heavyweight Tokio dependency, you can disable default features:
[dependencies]
rdkafka = { version = "0.25", default-features = false }To use a different asynchronous runtime like smol or async-std, you must provide a shim that implements the AsyncRuntime trait.