7 releases

0.1.7 Oct 29, 2024
0.1.6 Oct 19, 2024
0.1.5 Jul 28, 2024
0.1.4 Jan 14, 2024
0.1.0 Oct 7, 2023

#421 in Concurrency

Download history 103/week @ 2024-07-29 16/week @ 2024-08-05 23/week @ 2024-08-12 57/week @ 2024-08-19 2/week @ 2024-08-26 65/week @ 2024-09-02 39/week @ 2024-09-09 33/week @ 2024-09-16 14/week @ 2024-09-23 20/week @ 2024-09-30 36/week @ 2024-10-07 154/week @ 2024-10-14 61/week @ 2024-10-21 135/week @ 2024-10-28 7/week @ 2024-11-04 6/week @ 2024-11-11

248 downloads per month

MIT license

14KB
274 lines

mlua-kafka

A Rust-native implementation of lua-kafka for mlua.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-kafka --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_kafka::preload(&lua);
let script = r#"
    local settings = {
        ['bootstrap.servers'] = '127.0.0.1:9092',
    }
    local producer = require('kafka').producer(settings)
    producer:produce('topic', 'mykey', 'myvalue')
    producer:flush(100)
"#;
lua.load(script).exec()?;

Integration Testing

$ KAFKA_BROKERS=127.0.0.1:9092 KAFKA_TOPIC=mytopic cargo test

Dependencies

~15–23MB
~289K SLoC