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.

Reply via email to