Communicating Between Actors
Learn how actors can call other actors and share data
Actors can communicate with each other using the inline client, enabling complex workflows and data sharing between different actor instances.
Note
This guide focuses on communication between actors within the same application. For connecting to actors from client applications, see Communicating with Actors.
Using the Inline Client
The inline client allows actors to call other actors within the same registry. Access it via c.client()
in your actor actions:
Communication Patterns
The inline client supports the same communication patterns as external clients. See Communicating with Actors - Actor Handles for details on:
getOrCreate()
for stateless request-response.connect()
for real-time communication with eventsget()
andcreate()
for explicit actor lifecycle management
Error Handling
Handle errors gracefully when calling other actors. Error handling works the same as with external clients - see Communicating with Actors - Error Handling for details.
Use Cases and Patterns
Actor Orchestration
Use a coordinator actor to manage complex workflows:
Data Aggregation
Collect data from multiple actors:
Event-Driven Architecture
Use connections to listen for events from other actors:
Advanced Features
Type Safety
The inline client maintains full type safety across actor boundaries:
Performance Optimization
Batch Operations: Process multiple items in parallel:
Connection Reuse: Reuse connections for multiple operations:
Testing
Mock the inline client for unit testing: