GitXplorerGitXplorer
s

rust-sidekiq

public
26 stars
8 forks
1 issues

Commits

List of commits on branch master.
Verified
b2be2abd0e4188c8777b13dd359352eea903077d

Merge pull request #23 from spk/dependabot/cargo/redis-0.27

sspk committed 4 months ago
Verified
b77549e14c0630834c31a5d97d72066cca54a0d6

Update redis requirement from 0.26 to 0.27

ddependabot[bot] committed 4 months ago
Verified
a62175a02581646cc25b52a9884cdb4934f93177

Merge pull request #22 from spk/dependabot/cargo/redis-0.26

sspk committed 6 months ago
Verified
cc4e8c892e238ac70d5886900beaa91fb0a94589

Update redis requirement from 0.25 to 0.26

ddependabot[bot] committed 6 months ago
Verified
3109fbebb758208979ac13376ba9e1febd68d9d1

Merge pull request #21 from spk/dependabot/cargo/redis-0.25

sspk committed 6 months ago
Verified
52782bb7619f78341b144e87b7d0a3ac6bad7ade

Update redis requirement from 0.23 to 0.25

ddependabot[bot] committed 6 months ago

README

The README file for this repository.

Rust Sidekiq Client

Sidekiq client allowing to push jobs. Using the Sidekiq job format as reference.

Dependencies

Installation

[dependencies]
sidekiq = "0.12"

Default environment variables

  • REDIS_URL="redis://127.0.0.1/"

Used by

Examples

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 laurent@spkdev.net


Build Version Documentation License Dependency status