#events #send-event #topic #subscription #serde-json #client #tokio

pikav

A library that help you send event to client with topic subscription

48 releases (11 breaking)

0.20.14 Feb 27, 2024
0.20.11 Jan 22, 2024
0.20.7 Dec 25, 2023
0.20.5 Nov 27, 2023
0.10.1 Jun 19, 2022

#6 in #send-event


Used in pikav-web

Apache-2.0

15KB
362 lines

A library that help you send event to client with topic subscription


Getting Started

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();
}

Dependencies

~0.5–8MB
~52K SLoC