Request send/publish of CurrentClusterState, see #2438
* Added publishCurrentClusterState and sendCurrentClusterState * Removed Ping/Pong that was used for some tests, since awaitCond is now needed anyway, since publish to eventStream is done afterwards
This commit is contained in:
parent
e55cde2591
commit
50d0efe7d4
5 changed files with 57 additions and 31 deletions
|
|
@ -189,6 +189,24 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
|
|||
def unsubscribe(subscriber: ActorRef): Unit =
|
||||
clusterCore ! InternalClusterAction.Unsubscribe(subscriber)
|
||||
|
||||
/**
|
||||
* Publish current (full) state of the cluster to subscribers,
|
||||
* that are subscribing to [[akka.cluster.ClusterEvent.ClusterDomainEvent]]
|
||||
* or [[akka.cluster.ClusterEvent.CurrentClusterState]].
|
||||
* If you want this to happen periodically you need to schedule a call to
|
||||
* this method yourself.
|
||||
*/
|
||||
def publishCurrentClusterState(): Unit =
|
||||
clusterCore ! InternalClusterAction.PublishCurrentClusterState(None)
|
||||
|
||||
/**
|
||||
* Publish current (full) state of the cluster to the specified
|
||||
* receiver. If you want this to happen periodically you need to schedule
|
||||
* a call to this method yourself.
|
||||
*/
|
||||
def sendCurrentClusterState(receiver: ActorRef): Unit =
|
||||
clusterCore ! InternalClusterAction.PublishCurrentClusterState(Some(receiver))
|
||||
|
||||
/**
|
||||
* Try to join this cluster node with the node specified by 'address'.
|
||||
* A 'Join(thisNodeAddress)' command is sent to the node to join.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue