Hi Unmesh,

On Wednesday, September 27, 2017 at 3:01:24 PM UTC+2, Unmesh Joshi wrote:
>
> I was trying to go through the code to understand how GraphStages receive 
> actor messages. I see that GraphStageActor is a actor not created like 
> normal actors. I looks like all the messages to GraphStageActors are 
> wrapped in AsyncInput and passed to ActorGraphInterpreter. This means 
> messages to all the graph stages will essentially be executed by a single 
> ActorGraphInterpreter actor. Is this understanding true? If so, is there is 
> any specific reason for create GraphStageActor the way it is?
>

I guess you mean the ActorRef created when calling `getStageActor` in a 
GraphStage. Yes, your understanding is correct here. The basic reason is 
that stages that belong to one "fused island" are run together in a single 
actor. Consequently, messages received for those stages also need to be 
handled in the context of that actor to ensure the thread-safety of 
GraphStages. The benefit is that you can access and modify internal state 
of your GraphStage from within the message handler of the stage actor.

Does that make sense? What would you have expected instead?

Johannes
 

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to