Cluster.unsubscribe with class parameter, see #2567

This commit is contained in:
Patrik Nordwall 2012-09-28 13:09:36 +02:00
parent ddde23576f
commit 51ff9ce6d1
4 changed files with 22 additions and 7 deletions

View file

@ -185,10 +185,17 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
clusterCore ! InternalClusterAction.Subscribe(subscriber, to)
/**
* Unsubscribe to cluster domain events.
* Unsubscribe to all cluster domain events.
*/
def unsubscribe(subscriber: ActorRef): Unit =
clusterCore ! InternalClusterAction.Unsubscribe(subscriber)
clusterCore ! InternalClusterAction.Unsubscribe(subscriber, None)
/**
* Unsubscribe to a specific type of cluster domain events,
* matching previous `subscribe` registration.
*/
def unsubscribe(subscriber: ActorRef, to: Class[_]): Unit =
clusterCore ! InternalClusterAction.Unsubscribe(subscriber, Some(to))
/**
* Publish current (full) state of the cluster to subscribers,