Crates.io | pikav |
lib.rs | pikav |
version | 0.20.14 |
source | src |
created_at | 2022-06-16 21:22:17.67915 |
updated_at | 2024-02-27 04:01:49.348577 |
description | A library that help you send event to client with topic subscription |
homepage | https://pikav.timada.co |
repository | https://github.com/timayz/pikav |
max_upload_size | |
id | 607670 |
size | 14,255 |
A library that help you send event to client with topic subscription
use serde_json::json;
use pikav_client::{Client, ClientOptions, Event};
#[tokio::main]
async fn main() -> std::io::Result<()> {
let pikav = Pikav::new();
let filter = TopicFilter::new("todos/+")?;
pikav.subscribe(SubscribeOptions {
filter,
user_id: "xx-user-id-xx",
client_id: "xx-client-id-xx",
})
.ok();
}