etcdmq 0.0.3

Lightweight Message Queue backed by etcd
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[tokio::main]
async fn main() {
    tracing_subscriber::fmt::init();

    // tracing_subscriber::fmt()
    //     .with_max_level(Level::TRACE)
    //     .with_span_events(format::FmtSpan::ACTIVE)
    //     // .json()
    //     .init();

    let mut client = Client::connect(["localhost:2379"], None).await.unwrap();
    let mut f = Queue::new(client, "test2".to_string(), None).await.unwrap();
    f.send("testing message").await;
    let msg = f.try_recv().await;
    println!("{:?}", msg);
    sleep(Duration::from_secs(5)).await;
}