This class contains logic used by a Router to route a message to a Routee determined using round-robin. This process has the router select from a list of routees in sequential order. When the list has been exhausted, the router iterates again from the beginning of the list. For concurrent calls, round robin is just a best effort.
Inheritance: RoutingLogic
        /// <summary>
        /// Creates cluster publish subscribe settings from provided configuration with the same layout as `akka.cluster.pub-sub`.
        /// </summary>
        public static DistributedPubSubSettings Create(Config config)
        {
            RoutingLogic routingLogic = null;
            var routingLogicName = config.GetString("routing-logic");
            switch (routingLogicName)
            {
                case "random":
                    routingLogic = new RandomLogic();
                    break;
                case "round-robin":
                    routingLogic = new RoundRobinRoutingLogic();
                    break;
                case "broadcast":
                    routingLogic = new BroadcastRoutingLogic();
                    break;
                case "consistent-hashing":
                    throw new ArgumentException("Consistent hashing routing logic cannot be used by the pub-sub mediator");
                default:
                    throw new ArgumentException("Unknown routing logic is tried to be applied to the pub-sub mediator: " +
                                                routingLogicName);
            }

            return new DistributedPubSubSettings(
                config.GetString("role"),
                routingLogic,
                config.GetTimeSpan("gossip-interval"),
                config.GetTimeSpan("removed-time-to-live"),
                config.GetInt("max-delta-elements"));
        }
 public void RoundRobin_should_not_throw_IndexOutOfRangeException_when_counter_wraps_to_be_negative()
 {
     var routees = new[] {Routee.NoRoutee, Routee.NoRoutee, Routee.NoRoutee};
     var routingLogic = new RoundRobinRoutingLogic(int.MaxValue - 5);
     for (var i = 0; i < 10; i++)
     {
         routingLogic.Select(i, routees);
     }
 }