Class RoutingLogics.ConsistentHashingLogic<T>

java.lang.Object
org.apache.pekko.actor.typed.internal.routing.RoutingLogics.ConsistentHashingLogic<T>
All Implemented Interfaces:
RoutingLogic<T>
Enclosing class:
RoutingLogics

public static final class RoutingLogics.ConsistentHashingLogic<T> extends Object implements RoutingLogic<T>
  • Constructor Details

    • ConsistentHashingLogic

      public ConsistentHashingLogic(int virtualNodesFactor, scala.Function1<T,String> mapping, Address baseAddress)
  • Method Details

    • routeesUpdated

      public void routeesUpdated(scala.collection.immutable.Set<ActorRef<T>> newRoutees)
      Description copied from interface: RoutingLogic
      Invoked an initial time before selectRoutee is ever called and then every time the set of available routees changes.

      Specified by:
      routeesUpdated in interface RoutingLogic<T>
      Parameters:
      newRoutees - The updated set of routees. For a group router this could be empty, in that case selectRoutee() will not be called before routeesUpdated is invoked again with at least one routee. For a pool the pool stops instead of ever calling routeesUpdated with an empty list of routees.
    • selectRoutee

      public ActorRef<T> selectRoutee(T msg)
      Specified by:
      selectRoutee in interface RoutingLogic<T>