.NET API
SingletonExecutionOptions
Tracon.Abstractions.dllThe settings of single-executor election.
public sealed class SingletonExecutionOptionsInheritance
Section titled “Inheritance”object ← SingletonExecutionOptions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”They are read from the Tracon:SingletonExecution configuration section. See
TraconServiceCollectionExtensions.AddTracon.
Constructors
Section titled “Constructors”SingletonExecutionOptions()
Section titled “ SingletonExecutionOptions()”public SingletonExecutionOptions()Fields
Section titled “Fields”SectionName
Section titled “ SectionName”The name of the configuration section.
public const string SectionName = "Tracon:SingletonExecution"Field Value
Section titled “Field Value”Properties
Section titled “Properties”Enabled
Section titled “ Enabled”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; }Property Value
Section titled “Property Value”LeaseDuration
Section titled “ LeaseDuration”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; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”While SingletonExecutionOptions.Enabled is true this must be at least THREE SECONDS, and startup fails otherwise. Renewal never runs faster than once a second, so below that the renewal would land on or after the expiry: the lease would look expired while its owner is alive, and a second instance would take over work that has to run on one.
OwnerId
Section titled “ OwnerId”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; }