A BalancingPool tries to redistribute the work among the actors for performance improvement. In the BalancingPool, all actors share the same mailbox.
Creating a BalancingPool of actors
Getting ready
Just import the Hello-Akka project in the IDE; other prerequisites are the same as before.
How to do it...
- Create a Scala file, Balancingpool.scala, in the package com.packt.chapter3.
- Add the following imports at the top of the file:
import akka.actor.{Props, ActorSystem, Actor}
import akka.routing.BalancingPool
- Define a simple actor as an example:
class BalancingPoolActor extends Actor ...