iluwatar / iluwatar/java-design-patterns
Implement Actor Model pattern
Open
@ssrijan-007-sys is already working on this.
Since Apr 14, 2025.
epic: pattern
Stale
type: feature
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description
The Actor Model is a concurrency paradigm in which independent “actors” encapsulate state and behavior, interacting solely through asynchronous message passing. This approach avoids shared mutable state and promotes highly scalable, loosely coupled systems. Actors can create new actors, send messages to other actors, and handle messages they receive.
Key Elements
- Actors: Independent units that manage their own state and process messages.
- Message Passing: Non-blocking communication between actors; no direct method calls or shared variables.
- Isolation: Each actor’s state is private, limiting concurrency issues.
- Supervision: Some actor frameworks use a hierarchy where parent actors supervise the lifecycle and errors of child actors.
References
- Akka Documentation (Actor Model in JVM)
- The Actor Model (Wikipedia)
- Java Design Patterns – Contribution Guidelines
Acceptance Criteria
- Create a new module or package named
actor-model(or similar). - Provide a minimal actor-based system where multiple actors exchange messages to accomplish a task.
- Demonstrate key concepts: actor creation, message handling, isolation of state, and error handling or supervision.
- Include a README (
.mdfile) explaining the pattern, including code walkthrough and any relevant diagrams. - Write tests verifying actor interactions, ensuring correct behavior under concurrent loads.
- Pass all repository checks (style conventions, CI build/tests).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.