theater/lib.rs
1//! # Theater Actor System
2//!
3//! Theater is a runtime for managing and executing WebAssembly actors in a distributed system.
4//! It provides a framework for creating, managing, and communicating with actors that are
5//! implemented as WebAssembly components.
6//!
7//! ## Core Features
8//!
9//! * **Actor Management**: Create, start, stop, and monitor actors
10//! * **State Management**: Persistent actor state with event chain tracking
11//! * **Message Passing**: Communication between actors and external systems
12//! * **WebAssembly Integration**: Run actors as sandboxed WebAssembly components
13//! * **Extensible Handlers**: Support for HTTP, WebSockets, and custom protocols
14//!
15//! ## Architecture
16//!
17//! Theater is built around these key components:
18//!
19//! * `TheaterRuntime`: The central runtime that manages the lifecycle of actors
20//! * `ActorRuntime`: Manages the execution environment for a single actor
21//! * `ActorHandle`: Provides an interface for interacting with actors
22//! * `StateChain`: Tracks the history of state changes for an actor
23//!
24//! ## Example Usage
25//!
26//!
27//! ## Security and Safety
28//!
29//! Theater runs actors in isolated WebAssembly environments with configurable resource limits
30//! and capabilities. This provides strong security boundaries between actors and between
31//! actors and the host system.
32
33use anyhow::Result;
34
35pub mod actor;
36pub mod chain;
37pub mod client;
38pub mod config;
39pub mod errors;
40pub mod events;
41pub mod host;
42pub mod id;
43pub mod logging;
44pub mod messages;
45pub mod metrics;
46pub mod shutdown;
47pub mod store;
48pub mod theater_runtime;
49pub mod theater_server;
50pub mod utils;
51mod wasm;
52
53pub use actor::ActorError;
54pub use actor::ActorHandle;
55pub use actor::ActorOperation;
56pub use actor::ActorRuntime;
57pub use actor::ActorStore;
58pub use actor::StartActorResult;
59pub use chain::{ChainEvent, StateChain};
60pub use config::{HandlerConfig, HttpServerHandlerConfig, ManifestConfig, MessageServerConfig};
61pub use errors::TheaterRuntimeError;
62pub use id::TheaterId;
63pub use metrics::{ActorMetrics, MetricsCollector, OperationStats};
64pub use wasm::{MemoryStats, WasmError};