Commit b57ad38
Add comprehensive Actors documentation guide (#1927)
Summary:
## PR Summary
This PR adds a complete guide to Monarch actors (`docs/ACTORS.md`) that serves as the reference for understanding and implementing the actor model in Monarch applications.
The documentation covers:
- **Actor fundamentals**: Definition, core characteristics (isolation, sequential processing, asynchronous communication, location transparency)
- **Actor lifecycle**: Complete walkthrough from creation through termination, including spawn, construction, initialization, running, and termination phases
- **Endpoints and messaging**: Detailed explanation of the `endpoint` decorator and messaging patterns including `call_one()`, `call()`, `broadcast()`, `rref()`, and `stream()`
- **Actor context**: How to access runtime information via the context API including message rank, actor instance details, and process references
- **ActorMesh**: Organization of actors in multidimensional structures with slicing, indexing, and broadcast operations
- **Advanced patterns**: Explicit response ports, actor supervision, channels for direct communication, and ValueMesh for state sharing
- **Best practices**: Actor design principles, state management, endpoint design, error handling, performance optimization, and testing strategies
The guide includes code examples, diagrams for visualization, and a quick reference card for common patterns. This documentation complements the existing Meshes guide and provides developers with everything needed to build robust actor-based distributed systems in Monarch.
Pull Request resolved: #1927
Reviewed By: colin2328
Differential Revision: D87400422
Pulled By: AlirezaShamsoshoara
fbshipit-source-id: e2f85896f9aacfc3266e5b875778d448a9da1fe51 parent a736b7e commit b57ad38
0 commit comments