Yeah. I meant ActorRef for GraphStage. My only question then is, if messages to all the GraphStage Actors get serialized to ActorGraphInterpreter, will that potentially limit the possible parallel execution? e.g. If HttpRequestParserStage and HttpResponseRendererStage both receive actor messages, they will get executed sequentially where it was potentially possible to handle them in parallel. Its hard to say how much of benefit this gives, but conceptually, thinking of each graph stage as a separate actor is simpler as opposed to thinking of a graph of stages backed by an Actor.
On Thursday, 28 September 2017 15:59:53 UTC+5:30, johannes...@lightbend.com wrote: > > 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 akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.