Skip to content

SingletonExecutionOptions

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The settings of single-executor election.

public sealed class SingletonExecutionOptions

objectSingletonExecutionOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

They are read from the AgentPrism:SingletonExecution configuration section. See AgentPrismServiceCollectionExtensions.AddAgentPrism.

public SingletonExecutionOptions()

The name of the configuration section.

public const string SectionName = "AgentPrism:SingletonExecution"

string

Gets or sets a value that turns on single-executor election. The default is false: behaviour does not change in a single-instance setup, and no query reaches the lease table.

public bool Enabled { get; set; }

bool

Gets or sets the lease duration. Renewal happens at ONE THIRD of this duration; at half of it, a single missed renewal would drop the lease.

public TimeSpan LeaseDuration { get; set; }

TimeSpan

Gets or sets the id of this instance. When it is null or empty it is generated automatically (machine name plus process id plus a unique suffix).

public string? OwnerId { get; set; }

string?