Hi Michael, We have discussed such proposal in the past and decided that it does not carry it’s own complexity weight.
We would have to special case some letters as markers, or introduce something else to mark what the “placeholder part” is, we also really do want to encourage developers to think about actor names - they are one of the most important things one has when debugging when something goes wrong (‘which actor?’ to which actor?’ ‘from which actor’?). Scala already has very nice built in string interpolation, so such a thing is as easy as writing s”something-$genId” For a more in-depth discussion on this idea please read the old issue: https://github.com/akka/akka/issues/16613 Hope this explains the reasoning behind not providing such facility. -- Cheers, Konrad 'ktoso’ Malawski Akka @ Typesafe On 4 May 2015 at 23:26:24, Michael Frank (syntaxjoc...@gmail.com) wrote: On 05/04/15 02:34, Akka Team wrote: -> What are the best practices for naming ? It would be ideal if I can give a name and Akka appends a $1, $2 to the name for every actor created. Akka does not provide such functionality, either you use temp names when it maintains a counter, or give an explicit name. Just use an AtomicLong if you want to add your own monotonic counter to names. i think it would be great to have the ability to supply a template to the name parameter of actorOf(), such that it generates a unique name in a particular format, similar to the mkstemp() libc function. for example: val fooActor = system.actorOf(props, name = "foo-XXXXXX") would create a toplevel user actor called "foo-$a" (if we assume current auto-naming behavior). is this something the akka team would accept a PR for in 2.4? it seems like a rather small, localized change, but i haven't looked into the actual implementation complexity. -Michael -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout. -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.