Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spk/rust-sidekiq
Rust Sidekiq Client
https://github.com/spk/rust-sidekiq
async client job queue rust sidekiq
Last synced: 3 months ago
JSON representation
Rust Sidekiq Client
- Host: GitHub
- URL: https://github.com/spk/rust-sidekiq
- Owner: spk
- License: mit
- Created: 2016-05-22T21:40:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-06T00:57:40.000Z (almost 2 years ago)
- Last Synced: 2024-03-23T11:03:47.562Z (10 months ago)
- Topics: async, client, job, queue, rust, sidekiq
- Language: Rust
- Homepage: https://docs.rs/sidekiq/
- Size: 183 KB
- Stars: 26
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Sidekiq Client
[Sidekiq](https://github.com/mperham/sidekiq) client allowing to push jobs.
Using the [Sidekiq job
format](https://github.com/mperham/sidekiq/wiki/Job-Format) as reference.## Dependencies
* [rand](https://github.com/rust-random/rand)
* [redis](https://github.com/mitsuhiko/redis-rs)
* [serde_json](https://github.com/serde-rs/json)## Installation
``` toml
[dependencies]
sidekiq = "0.12"
```## Default environment variables
* REDIS_URL="redis://127.0.0.1/"
## Used by
*
*## Examples
```rust
use sidekiq::{Job, Value};
use sidekiq::{Client, ClientOpts, create_redis_pool};
use time::{OffsetDateTime, Duration};let ns = "test";
let client_opts = ClientOpts {
namespace: Some(ns.to_string()),
..Default::default()
};
let pool = create_redis_pool().unwrap();
let client = Client::new(pool, client_opts);
let class = "MyClass".to_string();// basic job
let job = Job::new(class, vec![sidekiq::Value::Null], Default::default());
match client.push(job) {
Ok(_) => {},
Err(err) => {
println!("Sidekiq push failed: {}", err);
},
}// scheduled-jobs (perform_in)
let job = Job::new(class, vec![sidekiq::Value::Null], Default::default());
let interval = Duration::hours(1);
match client.perform_in(interval, job) {
Ok(_) => {},
Err(err) => {
println!("Sidekiq push failed: {}", err);
},
}// scheduled-jobs (perform_at)
let job = Job::new(class, vec![sidekiq::Value::Null], Default::default());
let start_at = OffsetDateTime::now_utc().checked_add(Duration::HOUR).unwrap();
match client.perform_at(start_at, job) {
Ok(_) => {},
Err(err) => {
println!("Sidekiq push failed: {}", err);
},
}
```## REFERENCES
*
*## LICENSE
The MIT License
Copyright (c) 2016-2021 Laurent Arnoud
---
[![Build](https://img.shields.io/github/workflow/status/spk/rust-sidekiq/CI/master.svg)](https://github.com/spk/rust-sidekiq/actions)
[![Version](https://img.shields.io/crates/v/sidekiq.svg)](https://crates.io/crates/sidekiq)
[![Documentation](https://img.shields.io/badge/doc-rustdoc-blue.svg)](https://docs.rs/sidekiq/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT "MIT")
[![Dependency status](https://deps.rs/repo/github/spk/rust-sidekiq/status.svg)](https://deps.rs/repo/github/spk/rust-sidekiq)