mirror of
https://github.com/Stone-Red-Code/RemoteExec.git
synced 2026-09-04 23:42:03 +02:00
Add source generator to generate ExecuteAsync overloads
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
namespace RemoteExec.Client.LoadBalancingStrategies;
|
||||
|
||||
/// <summary>
|
||||
/// A load balancing strategy that selects servers based on local backlog.
|
||||
/// </summary>
|
||||
public class LeastBacklogStrategy : ILoadBalancingStrategy
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public ServerConnection? SelectServer(IEnumerable<ServerConnection> availableServers)
|
||||
{
|
||||
return availableServers.MinBy(s => s.TaskChannel.Reader.Count);
|
||||
|
||||
Reference in New Issue
Block a user