LANCommander/LANCommander.Server.Services/SingleInstanceCoordinatorElection.cs
Pat Hartl 4fc1a45f88 Add support for horizontal scaling
This commit adds support to allow the LANCommander server to scale horizontally. Multiple instances of the application can be deployed for load-balancing purposes. This will require a load balancer in front of the instances, as well as either MySQL or PostgreSQL and a Redis cache.
2026-07-22 20:19:31 -05:00

14 lines
501 B
C#

using LANCommander.Server.Services.Abstractions;
namespace LANCommander.Server.Services;
/// <summary>
/// Default <see cref="ICoordinatorElection"/> used when horizontal scaling is disabled. There is
/// only one instance, so it is always the coordinator.
/// </summary>
public sealed class SingleInstanceCoordinatorElection : ICoordinatorElection
{
public bool IsLeader => true;
public Task<bool> TryAcquireAsync(CancellationToken cancellationToken = default) => Task.FromResult(true);
}