#send-event #events #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

#426 in Concurrency

Download history 31/week @ 2024-07-07 55/week @ 2024-09-22

55 downloads per month
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.4–7MB
~50K SLoC