Actor12 Framework
A lightweight, high-performance actor framework for Rust built on Tokio. This is a standalone version of the actor system extracted from the Runy project.
Features
- Type-safe messaging: Strongly typed actor messages with compile-time guarantees
- Async/await support: Built on Tokio for efficient async message handling
- Cancellation: Hierarchical cancellation system for clean shutdown
- Memory tracking: Built-in memory usage tracking for actors
- Flexible channels: Support for different message channel types
Quick Start
Add this to your Cargo.toml:
[]
= "0.0.4"
= { = "1", = ["full"] }
= "1.0"
= "0.3"
For complete examples and API documentation, see the documentation.
Examples
Run the examples to see the framework in action:
Basic Examples
# Simple echo server
# Counter with state management
Handler Pattern Examples
# Multiple message types with Handler trait
# Dynamic dispatch and routing
Advanced Examples
# Ping-pong between actors (see examples/ directory)
# Bank account with transactions
# Worker pool pattern
Core Concepts
The Actor12 framework is built around several key concepts:
- Actors: Isolated units of computation with their own state
- Messages: Type-safe communication via
Envelope<T, R>orHandler<M>patterns - Links: Thread-safe handles for sending messages to actors
- Cancellation: Hierarchical shutdown system for clean resource management
For detailed explanations and examples, see the API documentation.
Testing
License
This project inherits the license from the original Runy project.