client_sender/
client_sender.rsuse busrt::client::AsyncClient;
use busrt::ipc::{Client, Config};
use busrt::QoS;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let name = "test.client.sender";
let config = Config::new("/tmp/busrt.sock", name);
let mut client = Client::connect(&config).await?;
let opc = client
.publish("some/topic", "hello".as_bytes().into(), QoS::Processed)
.await?
.expect("no op");
opc.await??;
let opc = client
.send(
"test.client.listener",
"hello".as_bytes().into(),
QoS::Processed,
)
.await?
.expect("no op");
opc.await??;
let opc = client
.send_broadcast("test.*", "hello everyone".as_bytes().into(), QoS::Processed)
.await?
.expect("no op");
opc.await??;
Ok(())
}