Hi Rich, > 7 apr 2015 kl. 14:50 skrev Rich Henry <[email protected]>: > > > > On Tuesday, April 7, 2015 at 7:31:02 AM UTC-4, rkuhn wrote: > >> 6 apr 2015 kl. 22:15 skrev Rich Henry <[email protected] <javascript:>>: >> >> Hi, >> >> I would like to integrate an ActorPublisher with other actors created >> elsewhere, but I can't find a way to fully specify the path of the >> materialized ActorRef at configuration time, as the top-level path component >> always seems to be generated at runtime (i.e. "$a"). >> >> Is there a way to configure my Flow in a way where I can predict the full >> path for use in an .actorSelection() elsewhere? > > This sounds like a dangerous motivation to me: introducing Actors to each > other by passing ActorRefs around is much preferred and works almost > always—with the only exception of establishing first contact between > different systems. In this case it would be better to pass the ActorRef of > that other non-stream actor into the stream and have it introduce itself to > the outside. > > I suppose any time you use _.actorSelection() your process becomes a bit more > dynamic, and there are more things that can go wrong, but I also think there > are many situations in which it's perfectly desirable to do so. I'm not sure > I would classify it as a particularly dangerous motivation (excuse me if I > misunderstand what you mean by dangerous, i would be interested in any > elaboration).
The danger I was referring to is that depending on the precise layout of the supervision hierarchy is more brittle than passing ActorRefs around explicitly: the former will just break without warning while the latter can be noticed and fixed locally when changing a specific part of the hierarchy. My thinking for Akka Typed is to not include actorSelection at all—it is not currently present and its role may just be replaced by the Receptionist pattern, possibly coupled with CRDT-based knowledge dissemination of which service is offered where in a cluster. > I think the end result is that I just need to adjust my thinking when it > comes to streams -- to associate them more strongly with explicit, > supervised, data-processing roles. An easy adjustment to make. That being > said, I think the benefit of using them over, say, scalaz-stream, becomes > less compelling when you restrict their access patterns in this way. My recommendation would be to switch that view point around: the supervised Actor base of the stream implementation is not essential, other flow materializers might do things radically differently. Accessing Actors from within the stream looks the same whether you use Akka Streams or scalaz-stream AFAICT. What is the benefit that you feel is being lost? Regards, Roland > > I appreciate the response, Roland. > > - Rich > > > > Regards, > > Roland > >> >> The only solutions I can see right now is to wrap the Flow in another >> explicitly created Actor, which would just be boilerplate, or to find a way >> to pass the materialized ActorRef out into the wild via my own registration >> function. >> >> Any ideas? (and yes I did post a similarly composed question on >> StackOverflow here >> (http://stackoverflow.com/questions/29476654/is-there-a-way-to-get-predictable-actor-naming-with-akka-stream >> >> <http://stackoverflow.com/questions/29476654/is-there-a-way-to-get-predictable-actor-naming-with-akka-stream>) >> and will update that question with any solutions you guys may have) >> >> >> Thanks in advance, >> >> Rich Henry >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/> >> >>>>>>>>>> Check the FAQ: >> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html> >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> >>>>>>>>>> <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 >> <http://groups.google.com/group/akka-user>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > > Dr. Roland Kuhn > Akka Tech Lead > Typesafe <http://typesafe.com/> – Reactive apps on the JVM. > twitter: @rolandkuhn > <http://twitter.com/#!/rolandkuhn> > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/> > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html> > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > >>>>>>>>>> <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] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at http://groups.google.com/group/akka-user > <http://groups.google.com/group/akka-user>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. Dr. Roland Kuhn Akka Tech Lead Typesafe <http://typesafe.com/> – Reactive apps on the JVM. twitter: @rolandkuhn <http://twitter.com/#!/rolandkuhn> -- >>>>>>>>>> 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.
