https://github.com/densumesh/broccoli Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners + Executive Insights * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} densumesh / broccoli Public * Notifications You must be signed in to change notification settings * Fork 0 * Star 8 A robust message queue system for Rust applications, designed as a Rust alternative to Celery. License MIT license 8 stars 0 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights densumesh/broccoli main BranchesTags [ ] Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 8 Commits .vscode .vscode broccoli-core/src/ broccoli-core/src/ brokers brokers examples examples src src .gitignore .gitignore Cargo.lock Cargo.lock Cargo.toml Cargo.toml LICENSE.txt LICENSE.txt README.md README.md View all files Repository files navigation * README * MIT license Broccoli Crates.io Docs.rs License A robust message queue system for Rust applications, designed as a Rust alternative to Celery. Currently Redis-backed, with planned support for RabbitMQ, Kafka, and other message brokers. This is by no means a finished product, but we're actively working on it and would love your feedback and contributions! Features * Asynchronous message processing * Redis-backed persistence (with RabbitMQ and Kafka support planned) * Configurable retry strategies * Connection pooling * Type-safe message handling * Error handling with custom handlers * Flexible message processing patterns Installation Add this to your Cargo.toml: [dependencies] broccoli_queue = "0.1.0" Quick Start Producer use broccoli_queue::{queue::BroccoliQueue, brokers::broker::BrokerMessage}; use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] struct JobPayload { id: String, task_name: String, } #[tokio::main] async fn main() -> Result<(), Box> { // Initialize the queue let queue = BroccoliQueue::builder("redis://localhost:6379") .pool_connections(5) // Optional: Number of connections to pool .failed_message_retry_strategys(Default::default()) // Optional: Retry strategy (max retries, etc) .build() .await?; // Create some example jobs let jobs = vec![ JobPayload { id: "job-1".to_string(), task_name: "process_data".to_string(), }, JobPayload { id: "job-2".to_string(), task_name: "generate_report".to_string(), }, ]; // Publish jobs in batch queue.publish_batch( "jobs", // Queue name jobs // Jobs to publish ).await?; Ok(()) } Consumer use broccoli_queue::{queue::BroccoliQueue, brokers::broker::BrokerMessage}; use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Serialize, Deserialize)] struct JobPayload { id: String, task_name: String, } #[tokio::main] async fn main() -> Result<(), Box> { // Initialize the queue let queue = BroccoliQueue::builder("redis://localhost:6379") .pool_connections(5) .failed_message_retry_strategy(Default::default()) // Optional: Retry strategy (max retries, etc) .build() .await?; // Process messages queue.process_messages( "jobs", // Queue name Some(2), // Optional: Number of worker threads to spin up |message: BrokerMessage| async move { // Message handler println!("Processing job: {:?}", message); Ok(()) }, ).await?; Ok(()) } Why Broccoli? If you're familiar with Celery but want to leverage Rust's performance and type safety, Broccoli is your answer. While currently focused on Redis as the message broker, we're actively working on supporting multiple brokers to provide the same flexibility as Celery: * Redis (Current) * RabbitMQ (Planned) * Kafka (Planned) * And more to come! This multi-broker approach will allow you to choose the message broker that best fits your needs while maintaining a consistent API. Documentation * API Documentation Roadmap * [*] Redis broker implementation * [ ] RabbitMQ broker support * [ ] Kafka broker support * [ ] Proc macros for building workers * [ ] Additional message patterns * [ ] Enhanced monitoring and metrics * [ ] Web interface for job monitoring License MIT License Contributing Contributions are welcome! Please feel free to submit a Pull Request. We're particularly interested in contributions for: * New broker implementations * Additional message patterns * Performance improvements * Documentation enhancements * Bug fixes About A robust message queue system for Rust applications, designed as a Rust alternative to Celery. Resources Readme License MIT license Activity Stars 8 stars Watchers 2 watching Forks 0 forks Report repository Releases No releases published Packages 0 No packages published Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.