=doc set up mailbox for BalancingPool documented #13961

This commit is contained in:
ivan-lorenz 2016-07-22 16:04:11 +02:00 committed by Johan Andrén
parent 6efec50c94
commit 1d0837856a
3 changed files with 40 additions and 0 deletions

View file

@ -311,6 +311,20 @@ with a ``thread-pool-executor`` hinting the number of allocated threads explicit
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-balancing-pool3
It is also possible to change the ``mailbox`` used by the balancing dispatcher for
scenarios where the default unbounded mailbox is not well suited. An example of such
a scenario could arise whether there exists the need to manage priority for each message.
You can then implement a priority mailbox and configure your dispatcher:
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-balancing-pool4
.. note::
Bear in mind that ``BalancingDispatcher`` requires a message queue that must be thread-safe for
multiple concurrent consumers. So it is mandatory for the message queue backing a custom mailbox
for this kind of dispatcher to implement akka.dispatch.MultipleConsumerSemantics. See details
on how to implement your custom mailbox in :ref:`mailboxes-java`.
There is no Group variant of the BalancingPool.
SmallestMailboxPool

View file

@ -102,6 +102,18 @@ akka.actor.deployment {
}
#//#config-balancing-pool3
#//#config-balancing-pool4
akka.actor.deployment {
/parent/router10c {
router = balancing-pool
nr-of-instances = 5
pool-dispatcher {
mailbox = myapp.myprioritymailbox
}
}
}
#//#config-balancing-pool4
#//#config-smallest-mailbox-pool
akka.actor.deployment {
/parent/router11 {

View file

@ -312,6 +312,20 @@ with a ``thread-pool-executor`` hinting the number of allocated threads explicit
.. includecode:: code/docs/routing/RouterDocSpec.scala#config-balancing-pool3
It is also possible to change the ``mailbox`` used by the balancing dispatcher for
scenarios where the default unbounded mailbox is not well suited. An example of such
a scenario could arise whether there exists the need to manage priority for each message.
You can then implement a priority mailbox and configure your dispatcher:
.. includecode:: code/docs/routing/RouterDocSpec.scala#config-balancing-pool4
.. note::
Bear in mind that ``BalancingDispatcher`` requires a message queue that must be thread-safe for
multiple concurrent consumers. So it is mandatory for the message queue backing a custom mailbox
for this kind of dispatcher to implement akka.dispatch.MultipleConsumerSemantics. See details
on how to implement your custom mailbox in :ref:`mailboxes-scala`.
There is no Group variant of the BalancingPool.
SmallestMailboxPool