Theta
A robust async actor framework for Rust with supervision and fault tolerance
Theta provides an actor model implementation, designed for building resilient and high performance concurrent systems. The framework emphasizes the "let it crash" philosophy on top of as small as possible code for reasoning.
Features
- Async-first design - Native integration with Tokio's async runtime
- Supervision trees - Panics are contained and handled gracefully through supervision hierarchy
- Efficient messaging - High-performance message passing between actors
Installation
Architecture
Theta implements the actor model with the following core principles:
- Actors are essentially a sigle tokio task with two mpsc channels
- ActorRef is an address of an actor to send messages
- Supervision tree provides a hierarchy of actors for managing failures
Core Components
Actor Trait
initialize()- Actor initialization with provided argumentsprocess_msg()- Message processing with panic safetysupervise()- Supervision strategy for child actor failureson_restart()- Pre-restart cleanup and preparationon_exit()- Final cleanup on actor termination
Supervision Model
- Panic of an actor escalates to its parent supervisor
- Parent decides how to handle the failure for the failed actor and the rest of the children
License
Licensed under the MIT License.