redeez

Crates.ioredeez
lib.rsredeez
version0.1.2
sourcesrc
created_at2023-01-16 01:30:44.38085
updated_at2024-05-12 03:21:18.954752
descriptionA simple queueing system for Redis
homepage
repositoryhttps://github.com/m1guelpf/redeez-rs
max_upload_size
id759789
size30,551
Miguel Piedrafita (m1guelpf)

documentation

README

redeez

crates.io download count badge docs.rs

A simplified general-purpose queueing system for Rust apps.

Example

// Create a new Redeez object, and define your queues
let mut queues = Redeez::new(redis)
        .queue("avatars:resize", |job| -> Result<()> {
            // -- snip --

            Ok(())
        })
        .queue("images:resize", resize_images);

// Start queue workers in the background
queues.listen();

// Dispatch some jobs into the queue
queues.dispatch("images:resize", json!(["image1.jpg", "image2.jpg"]));
queues.dispatch("avatars:resize", json!(["avatar1.jpg", "avatar2.jpg"]));

// When shutting your program down, stop listening for jobs
queues.shutdown();

Acknowledgements

This project is very heavily inspired by v3xlabs' redeez npm package. Extra thanks to @lucemans for helping me understand Redis.

License

Redeez is released under the MIT License. See the LICENSE file for details.

Commit count: 14

cargo fmt