in app/event/Behaviours.scala [57:74]
def sendAmiCreatedNotification(
amiCreated: (Bake, AmiId) => Unit
)(implicit dynamo: Dynamo, ec: ExecutionContext): Behavior[BakeEvent] = {
Behaviors.receiveMessage[BakeEvent] { message =>
message match {
case AmiCreated(bakeId, amiId) =>
log.info("Received an AMI created event")
for {
bake <- Bakes.findById(bakeId.recipeId, bakeId.buildNumber)
} {
log.info(s"Notifying that $amiId exists")
amiCreated(bake, amiId)
}
case _ => // discard
}
Behaviors.same
}
}