For this recipe, we need to perform the following steps:
- Let's start with the worker actors. These actors are the children that you want to terminate in order. Create a file named ServiceHandler.scala inside package com.packt.chapter10 with the following content:
package com.packt.chapter10 import akka.actor.{Actor, ActorLogging} class ServiceHandler extends Actor with ActorLogging { def receive = Actor.ignoringBehavior override def preStart() = log.info(s"${self.path.name} is running") override def postStop() = log.info(s"${self.path.name} has stopped") }
- Second, let's create the ServicesManager actor. This actor will act as the parent of the workers but it will receive the children from the real actor parent. Create ...