https://github.com/tqwewe/kameo Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * 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 }} tqwewe / kameo Public * * Notifications You must be signed in to change notification settings * Fork 7 * Star 393 Fault-tolerant Async Actors Built on Tokio docs.page/tqwewe/kameo License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT 393 stars 7 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 0 * Discussions * Actions * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Security * Insights tqwewe/kameo This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 137 Commits .github .github benches benches docs docs examples examples macros macros src src .envrc .envrc .gitignore .gitignore CHANGELOG.md CHANGELOG.md Cargo.toml Cargo.toml LICENSE-APACHE LICENSE-APACHE LICENSE-MIT LICENSE-MIT README.md README.md banner.png banner.png cliff.toml cliff.toml docs.json docs.json flake.lock flake.lock flake.nix flake.nix View all files Repository files navigation * README * Apache-2.0 license * MIT license Kameo Discord Book Crates.io Version docs.rs Crates.io Total Downloads Crates.io License GitHub Contributors GitHub Stars Kameo banner image What is Kameo Kameo is a lightweight Rust library for building fault-tolerant, distributed, and asynchronous actors. It allows seamless communication between actors across nodes, providing scalability, backpressure, and panic recovery for robust distributed systems. Feature Highlights * Async Rust: Each actor runs as a separate Tokio task, making concurrency easy and efficient. * Supervision: Link actors to create a fault-tolerant, self-healing actor hierarchy. * Remote Messaging: Send messages to actors on different nodes seamlessly. * Panic Safety: Panics are gracefully handled, allowing the system to recover and continue running. * Backpressure Management: Supports both bounded and unbounded mpsc messaging for handling load effectively. Use Cases Kameo is versatile and can be applied in various domains, such as: * Distributed Microservices: Build resilient microservices that communicate reliably over a distributed network. * Real-Time Systems: Ideal for building chat systems, multiplayer games, or real-time monitoring dashboards where low-latency communication is essential. * IoT Devices: Deploy lightweight actors on low-resource IoT devices for seamless networked communication. Getting Started Prerequisites * Rust installed (check rustup for installation instructions) * A basic understanding of asynchronous programming in Rust Installation Add kameo as a dependency in your Cargo.toml file: cargo add kameo Example: Defining an Actor use kameo::Actor; use kameo::message::{Context, Message}; use kameo::request::MessageSend; // Define an actor that will keep a count #[derive(Actor)] struct Counter { count: i64, } // Define the message for incrementing the count struct Inc { amount: i64 } // Implement how the actor will handle incoming messages impl Message for Counter { type Reply = i64; async fn handle(&mut self, msg: Inc, _ctx: Context<'_, Self, Self::Reply>) -> Self::Reply { self.count += msg.amount; self.count } } Spawn and message the actor. // Spawn the actor and get a reference to it let actor_ref = kameo::spawn(Counter { count: 0 }); // Use the actor reference to send a message and receive a reply let count = actor_ref.ask(Inc { amount: 42 }).send().await?; assert_eq!(count, 42); Additional Resources * Documentation * The Kameo Book * Crates.io * Discord Contributing Contributions are welcome! Whether you are a beginner or an experienced Rust developer, there are many ways to contribute: * Report issues or bugs * Improve documentation * Submit pull requests for new features or bug fixes * Suggest new ideas in discussions Join our community on Discord to connect with fellow contributors! License kameo is dual-licensed under either: * MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT) * Apache License, Version 2.0 (LICENSE-APACHE or http:// www.apache.org/licenses/LICENSE-2.0) at your option. --------------------------------------------------------------------- Home | Features | Use Cases | Get Started | Additional Resources | Contributing | License About Fault-tolerant Async Actors Built on Tokio docs.page/tqwewe/kameo Topics actors tokio Resources Readme License Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT Activity Stars 393 stars Watchers 8 watching Forks 7 forks Report repository Releases 7 v0.11.0 Latest Sep 29, 2024 + 6 releases Sponsor this project Sponsor Learn more about GitHub Sponsors Contributors 3 * * * Languages * Rust 99.6% * Other 0.4% 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.