Add source generator to generate ExecuteAsync overloads

This commit is contained in:
Stone_Red
2025-12-25 19:23:48 +01:00
parent 3e339b2b7a
commit 8211825bef
6 changed files with 108 additions and 1 deletions
@@ -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);
@@ -16,4 +16,10 @@
<ProjectReference Include="..\RemoteExec.Shared\RemoteExec.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RemoteExec.Generators\RemoteExec.Generators.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>