public void demonstrateDispatcher() {
//#dispatchers
Props props =
// “head” router actor will run on "router-dispatcher" dispatcher
// Worker routees will run on "pool-dispatcher" dispatcher
new RandomPool(5).withDispatcher("router-dispatcher").props(
Props.create(Worker.class));
ActorRef router = system.actorOf(props, "poolWithDispatcher");
//#dispatchers
}