upstash-qstash

Crates.ioupstash-qstash
lib.rsupstash-qstash
version0.3.0
sourcesrc
created_at2023-05-24 11:48:28.59639
updated_at2023-06-02 08:24:44.289198
descriptionUnofficial Rust client for Upstash QStash
homepage
repositoryhttps://github.com/arjunkomath/upstash-qstash-rust
max_upload_size
id872968
size13,977
Arjun Komath (arjunkomath)

documentation

https://docs.rs/upstash-qstash

README

Upstash QStash for Rust

crates.io docs.rs MIT OR Apache-2.0

At the moment this library supports a subset of features, I'm hoping to add more in the future.

You can find the docs here.

Installation

[dependencies]
upstash-qstash = "0.1.2"

Usage

use qstash::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), ()> {
    let qstash_client = upstash_qstash::Client::new("your-token".to_owned()).expect("Init failed");
    let body = serde_json::json!({
        "key1": "value1",
        "key2": "value2"
    });
    match qstash_client
        .publish_json(
            "url-or-token".to_owned(),
            &body,
        )
        .await
    {
        Ok(result) => println!("Published {:?}", result),
        Err(e) => println!("Error: {}", e),
    }
    Ok(())
}
Commit count: 14

cargo fmt