We've defined the behavior of the Chef actor to distribute work across mixers but left the waiting part uncovered, so let's look at that now.
We left the Chef definition for the mixing behavior as follows:
def mixing = Behaviors.unhandled[Command]
Actually, the Chef needs to know about the mixers that were created by its idle behavior. Though technically it is possible to do a children lookup, as described earlier, doing so will introduce an implicit assumption that, at the moment, we'll get the listing stating that all of the mixers are still processing jobs. This assumption might be wrong in a highly concurrent environment or in the case of failed mixers.
Therefore, we need to refactor the behavior constructor a bit:
def mixing(mixers: Set[ActorRef[Mixer.Mix]],
collected: Int,
manager: ActorRef[Manager...