// used when the new routee gets added to the server
// we stop the currently running actor's on each client
getContext().stop(getSelf());
}
} else if (message instanceof Task) {
Task task = (Task) message;
// check whether we have processed enough messages
if (messageProcessedCounter == 100) {
// tell the server, enough messages for me and shut me down
getContext().stop(getSelf());
getContext().system().shutdown();
} else {
log.info("Work Packet from server->" + task.getTaskNumber());
messageProcessedCounter++;
getSender().tell(new TaskFinished(task.getTaskNumber()));
}
}
}