protected override Routing ChooseRouteFor(IList <Routee> routees) { Routee least = null; int leastCount = int.MaxValue; foreach (var routee in routees) { var count = routee.PendingMessages; if (count == 0) { least = routee; break; } else if (count < leastCount) { least = routee; leastCount = count; } } return(least == null?Routing.Empty() : Routing.With(least)); }
/// <summary> /// See <see cref="Router{P}.ComputeRouting"/> /// </summary> protected internal override Routing <P> ComputeRouting() => Routing.With(Routees);
protected override Routing ChooseRouteFor(IList <Routee> routees) { var nextIndex = lastIndex++ % routees.Count; return(Routing.With(routees[nextIndex])); }
protected override Routing ChooseRouteFor(IList <Routee> routees) { return(Routing.With(routees)); }
protected internal override Routing <P> ComputeRouting() => Routing.With(NextRoutee());
protected override Routing ChooseRouteFor(IList <Routee> routees) { int index = random.Next(routees.Count); return(Routing.With(routees[index])); }