fourche

Crates.iofourche
lib.rsfourche
version0.2.0
sourcesrc
created_at2019-09-05 15:28:55.459686
updated_at2021-05-22 19:38:03.733262
descriptionA simple task queue named after a lion with forked tail (queue fourché), works with Redis.
homepagehttps://gitlab.com/grauwoelfchen/fourche
repositoryhttps://gitlab.com/grauwoelfchen/fourche
max_upload_size
id162448
size16,487
Yasuhiro Яша Asaka (grauwoelfchen)

documentation

https://gitlab.com/grauwoelfchen/fourche

README

Fourché

A simple task queue named after a lion with forked tail (queue fourché), works with Redis.

Example

#[derive(Debug, Deserialize, Serialize)]
struct Job {id: u64 }
// enqueue
let client = redis::Client::open("redis://127.0.0.1:6379/0").unwrap();
let mut conn = client.get_connection().unwrap();

let job = Job { id: 1 }

let mut queue = Queue::new("name", &mut conn);
if let Err(err) = queue.enqueue::<Job>(job) {
    println!("err: {}", err);
}
// dequeue
let client = redis::Client::open("redis://127.0.0.1:6379/0").unwrap();
let mut conn = client.get_connection().unwrap();

let mut queue = Queue::new("name", &mut conn);
loop {
  match queue.dequeue::<Job>() {
    Ok(job) => println!("job: {}", job),
    Err(err) => {
        println!("err: {}", err);
        break;
    },
  }
}
Commit count: 30

cargo fmt