Thanks, Martynas I have a client connecting to the server (actor based) using TCP. By per session, I mean per TCP connection, until the client disconnects. I need to have a way of creating a persistent actor initially and the same persistent actor reused for subsequent tcp connections. There will be many TCP connections (many clients) so I need to have a PersistentActorFactory which can look up these Persistent Actors based on a GUID.
My idea was to have the PersistentActorFactory as a singleton (This is a persistent actor too) essentially a map that stores the GUID and persistent actor(ActorRef) for the session. I use ActorSelection to get this factory and get a persistence actor ref for the GUID. if it does not exist, I create one and store it in the factory. However, my ActorSelection.tell is not reaching onReceiveCommand. Would appreciate your comments and any suggestions / existing patterns for this. Regards, TS On Saturday, May 16, 2015 at 2:03:12 AM UTC-7, Martynas Mickevičius wrote: > > Hi TS, > > what do you mean by "per Session" here? > > You could use many different tools to lookup actors. From the > actorSelection > <http://doc.akka.io/docs/akka/2.3.11/scala/actors.html#Identifying_Actors_via_Actor_Selection> > which > allows to look up actors by local or remote path, to Cluster Sharding > <http://doc.akka.io/docs/akka/2.3.11/contrib/cluster-sharding.html>, > which manages actor creation and lookup by symbolic names across the > cluster. > > On Wed, May 13, 2015 at 2:22 AM, TS <[email protected] <javascript:>> > wrote: > >> What is the best way to create a persistent actor once per session. >> Create it the first time, but look it up if it is already created. >> >> Thanks, TS >> >> -- >> >>>>>>>>>> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Martynas Mickevičius > Typesafe <http://typesafe.com/> – Reactive > <http://www.reactivemanifesto.org/> Apps on the JVM > -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
