Fix snippets in typed cluster docs

This commit is contained in:
Christopher Batey 2018-04-20 17:31:51 +01:00 committed by Konrad `ktoso` Malawski
parent 3809fac7d7
commit b6a27deaea
6 changed files with 23 additions and 23 deletions

View file

@ -887,7 +887,7 @@ your configuration file. This a limitation of the current version and will not b
@@@
Emitting event information (logs) from internals is always a tradeoff. The events that are usable for
Emitting event information (logs) from internals is always a trade off. The events that are usable for
the Akka developers are usually too low level to be of any use for users and usually need to be fine-grained enough
to provide enough information to be able to debug issues in the internal implementation. This usually means that
these logs are hidden behind special flags and emitted at low log levels to not clutter the log output of the user
@ -908,7 +908,7 @@ crashes unexpectedly.
* Very low overhead, specialized, binary logging that has no significant overhead and can be safely left enabled
for production systems.
The location of the file can be controlled via the *akka.remote.artery.advanced.flight-recoder.destination* setting (see
The location of the file can be controlled via the *akka.remote.artery.advanced.flight-recorder.destination* setting (see
@ref:[akka-remote (artery)](general/configuration.md#config-akka-remote-artery) for details). By default, a file with the *.afr* extension is produced in the temporary
directory of the operating system. In cases where the flight recorder casuses issues, it can be disabled by adding the
setting *akka.remote.artery.advanced.flight-recorder.enabled=off*, although this is not recommended.

View file

@ -1,5 +1,14 @@
# Cluster Singleton
@@@ warning
This module is currently marked as @ref:[may change](../common/may-change.md) in the sense
of being the subject of active research. This means that API or semantics can
change without warning or deprecation period and it is not recommended to use
this module in production just yet—you have been warned.
@@@
For some use cases it is convenient and sometimes also mandatory to ensure that
you have exactly one actor of a certain type running somewhere in the cluster.
@ -16,18 +25,10 @@ such as single-point of bottleneck. Single-point of failure is also a relevant c
but for some cases this feature takes care of that by making sure that another singleton
instance will eventually be started.
@@@ warning
This module is currently marked as @ref:[may change](../common/may-change.md) in the sense
of being the subject of active research. This means that API or semantics can
change without warning or deprecation period and it is not recommended to use
this module in production just yet—you have been warned.
@@@
## Dependency
To use Akka Cluster Singleton Typed, add the module to your project:
Cluster singleton is part of the cluster module:
@@dependency[sbt,Maven,Gradle] {
group=com.typesafe.akka
@ -40,13 +41,13 @@ To use Akka Cluster Singleton Typed, add the module to your project:
Any `Behavior` can be run as a singleton. E.g. a basic counter:
Scala
: @@snip [ShardingCompileOnlySpec.scala]($akka$/akka-cluster-sharding-typed/src/test/scala/doc/akka/cluster/sharding/typed/ShardingCompileOnlySpec.scala) { #sharding-extension }
: @@snip [ShardingCompileOnlySpec.scala]($akka$/akka-cluster-sharding-typed/src/test/scala/doc/akka/cluster/sharding/typed/ShardingCompileOnlySpec.scala) { #counter }
Java
: @@snip [ShardingCompileOnlyTest.java]($akka$/akka-cluster-sharding-typed/src/test/java/jdoc/akka/cluster/sharding/typed/ShardingCompileOnlyTest.java) { #sharding-extension }
: @@snip [ShardingCompileOnlyTest.java]($akka$/akka-cluster-sharding-typed/src/test/java/jdoc/akka/cluster/sharding/typed/ShardingCompileOnlyTest.java) { #counter }
Then on every node in the cluster, or every node with a given role, use the `ClusterSingleton` extension
to spawn the singleton. Only a single instance will run in the cluster:
to spawn the singleton. An instance will per data centre of the cluster:
Scala
@ -55,3 +56,7 @@ Scala
Java
: @@snip [ShardingCompileOnlyTest.java]($akka$/akka-cluster-sharding-typed/src/test/java/jdoc/akka/cluster/sharding/typed/ShardingCompileOnlyTest.java) { #singleton }
## Accessing singleton of another data centre
TODO

View file

@ -34,11 +34,8 @@ Java
And the minimum configuration required is to set a host/port for remoting and the `akka.actor.provider = "cluster"`.
Scala
: @@snip [BasicClusterExampleTest.java]($akka$/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java) { #cluster-imports }
@@snip [BasicClusterExampleSpec.scala]($akka$/akka-cluster-typed/src/test/scala/docs/akka/cluster/typed/BasicClusterExampleSpec.scala) { #config-seeds }
Java
: @@snip [BasicClusterExampleTest.java]($akka$/akka-cluster-typed/src/test/java/jdocs/akka/cluster/typed/BasicClusterExampleTest.java) { #cluster-imports }
## Cluster API extension