Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate rjq;

use std::time::Duration;
use std::thread::sleep;
use std::error::Error;
use rjq::Queue;

fn main() {
    fn process(uuid: String, _: Vec<String>) -> Result<String, Box<Error>> {
        sleep(Duration::from_millis(1000));
        println!("{}", uuid);
        Ok(format!("hi from {}", uuid))
    }

    let queue = Queue::new("redis://localhost/", "rjq");
    queue.work(process, None, Some(5), Some(10), None, Some(false), None).unwrap();
}