fourche

Crates.iofourche
lib.rsfourche
version0.3.0
sourcesrc
created_at2019-09-05 15:28:55.459686+00
updated_at2025-03-16 22:11:30.909678+00
descriptionA simple task queue named after a lion with forked tail (queue fourché), works with Redis.
homepagehttps://codeberg.org/grauwoelfchen/fourche
repositoryhttps://codeberg.org/grauwoelfchen/fourche
max_upload_size
id162448
size36,243
Yasha (grauwoelfchen)

documentation

https://docs.rs/crate/fourche

README

Fourché

crate::fourche doc::fourche

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

Repositories

This library is developed mainly on Codeberg.org, but the source code is hosted also on sourcehut.

Any patches, merge/pull requests or issues on those repositories are welcomed.

# the main branch is "trunk"
% git clone git@codeberg.org:grauwoelfchen/fourche.git
% git --no-pager branch -v
* trunk xxxxxxx XXX

Installation

% cargo install fourche

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;
    },
  }
}

License

Fourche
Copyright 2019-2025 Yasha

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Commit count: 0

cargo fmt