Data Flow
This page explains how data moves through the Theater system, from external inputs to actor processing and eventual outputs.
External Input Processing
HTTP Requests
For HTTP-based interactions:
- HTTP request arrives at Theater Server
- Server parses request and identifies target actor
- Request is converted to a message
- Message is recorded in Event Chain
- Message is queued for delivery to actor
CLI Commands
For CLI-initiated actions:
- User issues command via CLI
- CLI connects to Theater Server
- Command is converted to management message
- Message is recorded in Event Chain
- Server processes management command
Message Delivery
For actor-to-actor messaging:
- Sender actor invokes messaging API
- Message is recorded in Event Chain
- Message is queued for delivery
- Target actor receives message
Actor Processing
State Retrieval
When actors access state:
- Actor invokes Store API
- Runtime validates access request
- State request is recorded in Event Chain
- Store retrieves state data
- Data is returned to actor
Computation
During actor computation:
- Actor processes message data
- Actor may access state via Store
- Actor may use handlers for external services
- All handler invocations are recorded in Event Chain
State Updates
When actors modify state:
- Actor creates new state data
- Actor invokes Store API to save state
- Update request is recorded in Event Chain
- Store validates and persists new state
- Store returns new state reference to actor
External Output Processing
HTTP Responses
For HTTP response generation:
- Actor produces response data
- Response is recorded in Event Chain
- Response is converted to HTTP format
- HTTP response is sent to client
Event Streaming
For event subscription:
- Client subscribes to events via Theater Server
- New events are recorded in Event Chain
- Server filters events based on subscription
- Matching events are streamed to client
Special Data Flows
Supervision
During supervision operations:
- Runtime detects actor failure
- Failure is recorded in Event Chain
- Supervisor actor is notified
- Supervisor decides on action
- Supervisory action is recorded in Event Chain
- Runtime implements supervisory action
Replay
During event replay:
- Replay request identifies starting point
- Events are retrieved from Event Chain
- Actor state is initialized
- Events are applied sequentially
- Actor reaches target state
Understanding these data flows helps visualize how information moves through the Theater system and how different components collaborate to process data securely and deterministically.