#client #upstash #qstash

upstash-qstash

Unofficial Rust client for Upstash QStash

5 unstable releases

0.3.0 Jun 2, 2023
0.2.0 May 26, 2023
0.1.2 May 25, 2023
0.1.1 May 24, 2023
0.1.0 May 24, 2023

#3 in #upstash

49 downloads per month

MIT/Apache

13KB
170 lines

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

Dependencies

~4–16MB
~223K SLoC