Crate theater

Crate theater 

Source
Expand description

§Theater Actor System

Theater is a runtime for managing and executing WebAssembly actors in a distributed system. It provides a framework for creating, managing, and communicating with actors that are implemented as WebAssembly components.

§Core Features

  • Actor Management: Create, start, stop, and monitor actors
  • State Management: Persistent actor state with event chain tracking
  • Message Passing: Communication between actors and external systems
  • WebAssembly Integration: Run actors as sandboxed WebAssembly components
  • Extensible Handlers: Support for HTTP, WebSockets, and custom protocols

§Architecture

Theater is built around these key components:

  • TheaterRuntime: The central runtime that manages the lifecycle of actors
  • ActorRuntime: Manages the execution environment for a single actor
  • ActorHandle: Provides an interface for interacting with actors
  • StateChain: Tracks the history of state changes for an actor

§Example Usage

§Security and Safety

Theater runs actors in isolated WebAssembly environments with configurable resource limits and capabilities. This provides strong security boundaries between actors and between actors and the host system.

Re-exports§

pub use actor::ActorError;
pub use actor::ActorHandle;
pub use actor::ActorOperation;
pub use actor::ActorRuntime;
pub use actor::ActorStore;
pub use actor::StartActorResult;
pub use chain::ChainEvent;
pub use chain::StateChain;
pub use config::actor_manifest::HandlerConfig;
pub use config::actor_manifest::HttpServerHandlerConfig;
pub use config::actor_manifest::InterfacesConfig;
pub use config::actor_manifest::ManifestConfig;
pub use config::actor_manifest::MessageServerConfig;
pub use config::actor_manifest::RandomHandlerConfig;
pub use errors::TheaterRuntimeError;
pub use id::TheaterId;
pub use messages::ChannelEvent;
pub use metrics::ActorMetrics;
pub use metrics::MetricsCollector;
pub use metrics::OperationMetrics;
pub use metrics::OperationStats;
pub use metrics::ResourceMetrics;
pub use shutdown::ShutdownController;
pub use shutdown::ShutdownReceiver;
pub use shutdown::ShutdownSignal;
pub use shutdown::ShutdownType;
pub use store::ContentRef;
pub use store::ContentStore;
pub use store::Label;
pub use theater_runtime::TheaterRuntime;

Modules§

actor
Actor System
chain
Event Chain System
config
errors
events
host
id
Theater ID System
logging
messages
metrics
shutdown
store
theater_runtime
Theater Runtime
utils

Structs§

MemoryStats
WebAssembly Memory Statistics

Enums§

WasmError
WebAssembly Error Types