Akka29924 router pool bcast (#29927)

This commit is contained in:
eyal farago 2021-01-11 16:08:56 +02:00 committed by GitHub
parent 2dedb715a1
commit b8c79f8695
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 123 additions and 8 deletions

View file

@ -62,6 +62,17 @@ Scala
Java
: @@snip [RouterTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/RouterTest.java) { #pool-dispatcher }
### Broadcasting a message to all routees
Pool routers can be configured to identify messages intended to be broad-casted to all routees.
Therefore, the `PoolRouter` has a property to configure its `broadcastPredicate`:
Scala
: @@snip [RouterSpec.scala](/akka-actor-typed-tests/src/test/scala/docs/akka/typed/RouterSpec.scala) { #broadcast }
Java
: @@snip [RouterTest.java](/akka-actor-typed-tests/src/test/java/jdocs/akka/typed/RouterTest.java) { #broadcast }
## Group Router
The group router is created with a `ServiceKey` and uses the receptionist (see @ref:[Receptionist](actor-discovery.md#receptionist)) to discover