Dan Luu
Posts: 27
Nickname: amitra
Registered: Feb, 2013
|
|
Re: Ch 10.5, .withRouter and naming
|
Posted: Feb 28, 2013 9:17 AM
|
|
A related question is, what the heck does this change do?
So, now we've created a LeadFlightAttendant actor that uses a random router.
But, in LeadFlightAttendant.scala, we still have the following code:
def randomAttendant(): ActorRef = {context.children.take( scala.util.Random.nextInt(numberOfAttendants)+ 1).last}
def receive = { case GetFlightAttendant => sender ! Attendant(randomAttendant()) case m => randomAttendant() forward m }
So, we also need to make a change that's analogous to the PassengerSupervisor, to get this to really do what's intended, right? Or am I missing some magic that will cause this to work regardless?
|
|