I like to design good actor system for handling operations. My findings are, we can use actors for managing states, fault-tolerance but we can use future for performing operations. With actors and future, we will create a good concurrent system. Akka provide us pipe
pattern for sending future result to another actor easily.
There are multiple ways, used for creating an actors. If we need multiple actors, we can create child actors, or create actors independently and pass actors as a reference in constructor.
My point is, when we need to create child actors in our actor system or pass actors as a reference to actor system. In the world for Object Oriented Design
, Associations
are prefer then Inheritance
. We can use is-a
and has-a
for identify our relations. Is there any way for identify, when we need to create a child actor or pass actor as a reference in akka.
I have requirements like, Need to create 4 actors and one actor output is input of another actor. In this case, i am going for create child actor relationship as Supervisor -> Parent -> Child -> Child -> Child
. My system required fault tolerance also.
What will you suggest best practices for above example and what are the other best practices for design akka actor system ?
My preferred language is Java
but also Scala
will use.
Aucun commentaire:
Enregistrer un commentaire