Hi I want to implement a router strategy that on some event will send a message to the router, but I don't know how to get a reference to the router inside the strategy implementation.
This is what I'm trying to do:
val router = system.actorOf(RoundRobinPool(5, supervisorStrategy = OneForOneStrategy(){
case _: ActorKilledException => Escalate
case _: ActorInitializationException => Escalate
case _ => self ! SomeMsg(); Restart
}).props(Props(classOf[MyClass])))
Where self should be the router ActorRef
, but self is not recognized in this context.
I normally never create the case into the Router but outside
Then in my actor receiver function
Here you can see my Akka project with an example https://github.com/politrons/Akka