You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
431 B
C#
16 lines
431 B
C#
namespace JwKdsV.Core.LoadBalance
|
|
{
|
|
/// <summary>
|
|
/// Random Select
|
|
/// </summary>
|
|
/// <typeparam name="T"></typeparam>
|
|
public class RandomRouting<T> : Routing<T>
|
|
{
|
|
protected override T selectInternal(object message, T[] instances)
|
|
{
|
|
var randNext = ThreadLocalRandom.Current.Next(instances.Length);
|
|
return instances[randNext % instances.Length];
|
|
}
|
|
}
|
|
}
|