jboner/akka — comment on commit 8b71bf5bea435cc0ef2caa68a3e6afa4ac01da77
File: akka-actor/src/main/scala/akka/routing/Routing.scala line 64
By patriknw:

On Tue, Jan 10, 2012 at 10:09 AM, Roland Kuhn <
reply@reply.github.com
> wrote:

> wrt every call: yes, I agree that it should be handled in the pool
> implementation, so the hook should stay as is here. Down in the default
> impl I think it should only resize on every Nth message, based on the
> elasticity parameters. Otherwise one flip of the AtomicBoolean per message
> send would be too costly. I propose an atomic counter with a threshold, and
> the reduction is done by the one doing the resizing; anybody else just
> always increments.
>

Hmm, right now the AtomicBoolean is in RouterConfig, so that user's doesn't
have to implement concurrency stuff when writing their own Resizer. What
about placing the counter and the Nth message check there also, but the
Resizer decide how often by providing a method:

def resizeOnEachNthMessage: Int

The config of that belongs to the Resizer impl.

>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/jboner/akka/commit/8b71bf5bea435cc0ef2caa68a3e6afa4ac01da77#commitcomment-852491
>

--

Patrik Nordwall
Typesafe - Enterprise-Grade Scala from the Experts
Twitter: @patriknw