namespace ScrapperAPI.Options;
public enum DistributedMode
{
LocalOnly = 0,
Hybrid = 1,
PreferAgents = 2,
PreferLocal = 3
}
public sealed class WorkerOptions
{
public DistributedMode Mode { get; set; } = DistributedMode.Hybrid;
///
/// Lease duration for a queue item before it can be recovered by another worker.
///
public int LeaseSeconds { get; set; } = 120;
public LocalWorkerOptions Local { get; set; } = new();
public AgentOptions Agents { get; set; } = new();
}
public sealed class LocalWorkerOptions
{
public bool Enabled { get; set; } = true;
public int Concurrency { get; set; } = 1;
///
/// When Mode=PreferAgents, local worker will run only if no agent was seen within this window.
///
public int PreferAgentsGraceSeconds { get; set; } = 30;
}
public sealed class AgentOptions
{
public bool Enabled { get; set; } = true;
public bool RequireMutualTls { get; set; } = true;
}