Hello,
Thank you for your help. After reading your comment ("the router, not for it's routees") I remembered about actor groups (as opposed to pools).
I defined a common pinned dispatcher (in application.conf, directly under "akka" element):
pinnedDispatcher {
type = "PinnedDispatcher"
executor = "thread-pool-executor"
thread-pool-executor.allow-core-timeout = off
}
Then created worker actors first:
private lazy val workers = for (i <- 0 until MyWorkerCount) yield {
context.actorOf(Props[MyWorker].withDispatcher("pinnedDispatcher"), "myWorker" + i) //actor names need to be unique
}
And then created round robin actor group:
private lazy val workerGroup = context.actorOf(RoundRobinGroup(workers.map(_.path.toString)).props(), "workerGroup")
Now each worker actor in the group is running on a separate thread, and always on the same one.
Thanks,
M