# SingletonExecutionOptions

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.singletonexecutionoptions/
> Summary: SingletonExecutionOptions: The settings of single-executor election.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The settings of single-executor election.

```csharp
public sealed class SingletonExecutionOptions
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.singletonexecutionoptions/">SingletonExecutionOptions</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

They are read from the `Tracon:SingletonExecution` configuration section. See
`TraconServiceCollectionExtensions.AddTracon`.

## Constructors

### <a id="Tracon_SingletonExecutionOptions__ctor"></a> SingletonExecutionOptions\(\)

```csharp
public SingletonExecutionOptions()
```

## Fields

### <a id="Tracon_SingletonExecutionOptions_SectionName"></a> SectionName

The name of the configuration section.

```csharp
public const string SectionName = "Tracon:SingletonExecution"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_SingletonExecutionOptions_Enabled"></a> Enabled

Gets or sets a value that turns on single-executor election. The default is
[false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool): behaviour does not change in a single-instance setup, and
no query reaches the lease table.

```csharp
public bool Enabled { get; set; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_SingletonExecutionOptions_LeaseDuration"></a> 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.

```csharp
public TimeSpan LeaseDuration { get; set; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

While [SingletonExecutionOptions.Enabled](/api/tracon.singletonexecutionoptions/#Tracon_SingletonExecutionOptions_Enabled) is [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) 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.

### <a id="Tracon_SingletonExecutionOptions_OwnerId"></a> OwnerId

Gets or sets the id of this instance. When it is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty it
is generated automatically (machine name plus process id plus a unique suffix).

```csharp
public string? OwnerId { get; set; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?
