I've been working on getting some Akka examples up and running and have run into an issue that is giving me quite a bit of trouble. What's so strange to me is that there is code coming straight out of the documentation that isn't working.
import akka.actor._
import akka.routing.{ ActorRefRoutee, RoundRobinRoutingLogic, Router, Broadcast }
object TransformationManager {
case class ProcessFile(fileIt:Iterator[String])
case class ProcessLines(lines:List[List[String]], last:Boolean = false)
case class LinesProcessed(lines:List[List[String]], last:Boolean = false)
case object WorkAvailable
case object WorkRequest
}
class TransformationManager extends Actor {
import TransformationManager._
val workChunkSize = 10
val workersCount = 10
def receive = {
case ProcessFile(fileIt) =>
var router = {
val routees = Vector.fill(workersCount) {
val r = context.actorOf(Props[SampleWorker])
context watch r
ActorRefRoutee(r)
}
Router(RoundRobinRoutingLogic(), routees)
}
router ! Broadcast(WorkAvailable) //error here !!!!!!!!!
}
}
On the last line of code,
router ! Broadcast(WorkAvailable)
I get the error,
value ! is not a member of akka.routing.Router
I'm at a loss for why this isn't working.