Build Status docs.rs Crates.io Crates.io Crates.io

Memphis Rust Client

This is an unofficial client for Memphis, written in Rust. This is a work in progress and is not yet ready for production use.

Installation

Add the following to your Cargo.toml file:

toml [dependencies] memphis-rust-community = "0.2.0"

Usage

```rust use memphisrustcommunity::memphisclient::MemphisClient; use memphisrustcommunity::consumer::MemphisConsumerOptions; use memphisrust_community::station::MemphisStationsOptions;

[tokio::main]

async fn main() { let client = MemphisClient::new("localhost:6666", "root", "memphis").await.unwrap();

let station_options = MemphisStationsOptions::new("my-station");
let station = client.create_station(station_options).await.unwrap();

let consumer_options = MemphisConsumerOptions::new("my-consumer")
    .with_generate_unique_suffix(true);
let mut consumer = station.create_consumer(consumer_options).await.unwrap();

let mut message_receiver = consumer.consume().await.unwrap();
tokio::spawn(async move {
    loop {
        let msg = message_receiver.recv().await;
        // Do something with the message
        break;
    }
});

} ```

Supported Features