Expand description
§Acton Reactive
This crate provides the foundational components for the Acton asynchronous agent system, built on top of Tokio. It establishes a robust, message-passing framework with clear separation of concerns for agent state, runtime management, communication, and lifecycle.
§Key Concepts
- Agents (
ManagedAgent): Core computational units wrapping user-defined state and logic, managed by the runtime. - Handles (
AgentHandle): External references for interacting with agents (sending messages, stopping, supervising). - Messaging: Asynchronous communication via Tokio MPSC channels, using
messages implementing the
ActonMessagetrait. - Broker (
AgentBroker): Central publish-subscribe mechanism for topic-based message distribution. - Lifecycle & Supervision: Type-state pattern (
Idle,Started) for agents, lifecycle hooks, and hierarchical supervision. - Runtime (
AgentRuntime): Manages the overall system, including agent creation and shutdown. - Traits: Core interfaces (
AgentHandleInterface,Broker,Subscriber, etc.) define the framework’s capabilities.
§Quick Start
ⓘ
use acton_reactive::prelude::*;
#[acton_message]
struct MyMessage {
content: String,
}Modules§
- prelude
- A prelude module for conveniently importing the most commonly used items.