Added caution about custom routers to docs

This commit is contained in:
Björn Antonsson 2012-05-11 18:31:20 +02:00
parent 0879c0e545
commit 38d43aee13
2 changed files with 26 additions and 0 deletions

View file

@ -339,6 +339,19 @@ If you are interested in how to use the VoteCountRouter it looks like this:
.. includecode:: code/akka/docs/jrouting/CustomRouterDocTestBase.java#crTest
.. caution::
When creating a cutom router the resulting RoutedActorRef optimizes the
sending of the message so that it does NOT go through the routers mailbox
unless the route returns an empty recipient set.
This means that the ``route`` function defined in the ``RouterConfig``
or the function returned from ``CreateCustomRoute`` in
``CustomRouterConfig`` is evaluated concurrently without protection by
the RoutedActorRef: either provide a reentrant (i.e. pure) implementation
or do the locking yourself!
Configured Custom Router
************************

View file

@ -339,6 +339,19 @@ All in all the custom router looks like this:
If you are interested in how to use the VoteCountRouter you can have a look at the test class
`RoutingSpec <https://github.com/akka/akka/blob/master/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala>`_
.. caution::
When creating a cutom router the resulting RoutedActorRef optimizes the
sending of the message so that it does NOT go through the routers mailbox
unless the route returns an empty recipient set.
This means that the ``route`` function defined in the ``RouterConfig``
or the function returned from ``CreateCustomRoute`` in
``CustomRouterConfig`` is evaluated concurrently without protection by
the RoutedActorRef: either provide a reentrant (i.e. pure) implementation
or do the locking yourself!
Configured Custom Router
************************