Class PoolRouter<T>

  • Direct Known Subclasses:
    PoolRouterBuilder

    public abstract class PoolRouter<T>
    extends BehaviorImpl.DeferredBehavior<T>
    Route messages by randomly selecting the routee from the available routees.

    Random routing makes it less likely that every poolsize message from a single producer ends up in the same mailbox of a slow actor.

    • Constructor Detail

      • PoolRouter

        public PoolRouter()
    • Method Detail

      • withPoolSize

        public abstract PoolRouter<T> withPoolSize​(int poolSize)
        Set a new pool size from the one set at construction
        Parameters:
        poolSize - (undocumented)
        Returns:
        (undocumented)
      • withRandomRouting

        public abstract PoolRouter<T> withRandomRouting()
      • withRoundRobinRouting

        public abstract PoolRouter<T> withRoundRobinRouting()
        Route messages through round robin, providing a fair distribution of messages across the routees.

        Round robin gives fair routing where every available routee gets the same amount of messages

        This is the default for pool routers.

        Returns:
        (undocumented)