use elbus::client::AsyncClient;
use elbus::ipc::{Client, Config};
use elbus::QoS;
#[tokio::main]
async fn main() {
let name = "test.client.sender";
let config = Config::new("/tmp/elbus.sock", name);
let mut client = Client::connect(&config).await.unwrap();
let opc = client
.publish("some/topic", "hello".as_bytes().into(), QoS::Processed)
.await
.unwrap()
.unwrap();
opc.await.unwrap().unwrap();
let opc = client
.send(
"test.client.listener",
"hello".as_bytes().into(),
QoS::Processed,
)
.await
.unwrap()
.unwrap();
opc.await.unwrap().unwrap();
let opc = client
.send_broadcast("test.*", "hello everyone".as_bytes().into(), QoS::Processed)
.await
.unwrap()
.unwrap();
opc.await.unwrap().unwrap();
}