namespace StellaOps.Feedser.Core.Jobs;

public interface ILeaseStore
{
    Task<JobLease?> TryAcquireAsync(string key, string holder, TimeSpan leaseDuration, DateTimeOffset now, CancellationToken cancellationToken);

    Task<JobLease?> HeartbeatAsync(string key, string holder, TimeSpan leaseDuration, DateTimeOffset now, CancellationToken cancellationToken);

    Task<bool> ReleaseAsync(string key, string holder, CancellationToken cancellationToken);
}
