This is an unofficial client for Memphis, written in Rust. This is a work in progress and is not yet ready for production use.
Add the following to your Cargo.toml
file:
toml
[dependencies]
memphis-rust-community = "0.1.0"
```rust use memphisrustcommunity::memphisclient::MemphisClient; use memphisrustcommunity::consumer::memphisconsumer_options::MemphisConsumerOptions;
async fn main() { let client = MemphisClient::new("localhost:6666", "root", "memphis").await.unwrap(); let consumeroptions = MemphisConsumerOptions::new("my-station", "my-consumer"); let mut consumer = client.createconsumer(consumer_options).await.unwrap();
consumer.consume().await.unwrap();
tokio::spawn(async move {
loop{
let msg = consumer.message_receiver.recv().await;
// Do something with the message
break;
}
});
} ```