in pekko-sample-persistence-dc-scala/src/main/scala/sample/persistence/res/auction/Auction.scala [107:127]
private def eventTriggers(event: Event, newState: AuctionState): Unit = {
event match {
case finished: AuctionFinished =>
newState.phase match {
case Closing(alreadyFinishedAtDc) =>
context.log.infoN(
"AuctionFinished at {}, already finished at [{}]",
finished.atReplica,
alreadyFinishedAtDc.mkString(", "))
if (alreadyFinishedAtDc(replicationContext.replicaId)) {
if (shouldClose(newState)) context.self ! Close
} else {
context.log.info("Sending finish to self")
context.self ! Finish
}
case _ => // no trigger for this state
}
case _ => // no trigger for this event
}
}