scala - How to properly give actors a unique sensible name -


by default in akka actors name '$a', or '$a.$oi.$abc' when nested. makes sense give them proper name @ least can see sensible name in logs. ... there can 1 actor given name. how give actors sensible unique name?

i have experienced suffixing name millisecond timestamp not sufficient. still results in duplicate name exceptions. these way nano-timestamp, have read getting expensive.

it nice if default akka naming used, suffixed or prefixed custom name.

any ideas?

you can increment counter , use time create new actor.

var counter = 0 val = actorsystem.actorof(props[myactorclass], s"actor-$counter") counter += 1 

Comments