The next step towards termination detection (#7) is implementing the algorithm.
[x] Implement a function findTerminated(snapshots: Map[ActorRef, Snapshot]): List[ActorRef]. Given a map from actor names to snapshots, returns a list of all the actors that are terminated in that set.
[x] Implement tests for the findTerminated function. We don't need to implement any actor interactions here; it's sufficient to create the set of snapshots manually.
The naive implementation of TerminationDetector is to keep all of the snapshots in its local state and then run findTerminated each time that addSnapshot is called. I think that we can maintain some data structures in such a way that the algorithm will run much faster; ideally, addSnapshot should run in constant time.
The next step towards termination detection (#7) is implementing the algorithm.
findTerminated(snapshots: Map[ActorRef, Snapshot]): List[ActorRef]
. Given a map from actor names to snapshots, returns a list of all the actors that are terminated in that set.findTerminated
function. We don't need to implement any actor interactions here; it's sufficient to create the set of snapshots manually.The naive implementation of
TerminationDetector
is to keep all of the snapshots in its local state and then runfindTerminated
each time thataddSnapshot
is called. I think that we can maintain some data structures in such a way that the algorithm will run much faster; ideally,addSnapshot
should run in constant time.