Merge pull request #21813 from akka/wip-21518-patriknw

minor cleanup of cluster.subscribe usage
This commit is contained in:
Patrik Nordwall 2016-11-16 21:33:02 +01:00 committed by GitHub
commit a7eed00948
2 changed files with 4 additions and 3 deletions

View file

@ -24,6 +24,7 @@ import akka.cluster.MemberStatus
import akka.AkkaException
import akka.actor.NoSerializationVerificationNeeded
import akka.cluster.UniqueAddress
import akka.cluster.ClusterEvent
object ClusterSingletonManagerSettings {
@ -435,7 +436,7 @@ class ClusterSingletonManager(
require(!cluster.isTerminated, "Cluster node must not be terminated")
// subscribe to cluster changes, re-subscribe when restart
cluster.subscribe(self, classOf[MemberExited], classOf[MemberRemoved])
cluster.subscribe(self, ClusterEvent.InitialStateAsEvents, classOf[MemberExited], classOf[MemberRemoved])
setTimer(CleanupTimer, Cleanup, 1.minute, repeat = true)
@ -715,7 +716,6 @@ class ClusterSingletonManager(
}
whenUnhandled {
case Event(_: CurrentClusterState, _) stay
case Event(MemberExited(m), _)
if (m.uniqueAddress == cluster.selfUniqueAddress) {
selfExited = true