=clu #18345 Support local address in cluster commands
* and clarify the doc sample for leave
This commit is contained in:
parent
4cbfe3d682
commit
f98b4c1f5e
6 changed files with 113 additions and 7 deletions
27
akka-docs/rst/scala/code/docs/cluster/ClusterDocSpec.scala
Normal file
27
akka-docs/rst/scala/code/docs/cluster/ClusterDocSpec.scala
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://www.typesafe.com>
|
||||
*/
|
||||
package docs.cluster
|
||||
|
||||
import akka.cluster.Cluster
|
||||
import akka.testkit.AkkaSpec
|
||||
|
||||
object ClusterDocSpec {
|
||||
|
||||
val config =
|
||||
"""
|
||||
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
|
||||
akka.remote.netty.tcp.port = 0
|
||||
"""
|
||||
}
|
||||
|
||||
class ClusterDocSpec extends AkkaSpec(ClusterDocSpec.config) {
|
||||
|
||||
"demonstrate leave" in {
|
||||
//#leave
|
||||
val cluster = Cluster(system)
|
||||
cluster.leave(cluster.selfAddress)
|
||||
//#leave
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue