A simplified general-purpose queueing system for Rust apps.
// 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();
This project is very heavily inspired by v3xlabs' redeez
npm package. Extra thanks to @lucemans for helping me understand Redis.
Redeez is released under the MIT License. See the LICENSE file for details.