Crates.io | redeez |
lib.rs | redeez |
version | 0.1.2 |
source | src |
created_at | 2023-01-16 01:30:44.38085 |
updated_at | 2024-05-12 03:21:18.954752 |
description | A simple queueing system for Redis |
homepage | |
repository | https://github.com/m1guelpf/redeez-rs |
max_upload_size | |
id | 759789 |
size | 30,551 |
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.